Class: Integer
- Inherits:
-
Object
- Object
- Integer
- Defined in:
- lib/core_ext.rb
Overview
Here we add some syntax sugar to make the code more understandable later
Instance Method Summary collapse
Instance Method Details
#interval_name ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/core_ext.rb', line 29 def interval_name { 1 => 'Unison', 2 => 'Second', 3 => 'Third', 4 => 'Fourth', 5 => 'Fifth', 6 => 'Sixth', 7 => 'Seventh', 8 => 'Octave', 9 => 'Ninth', 10 => 'Tenth', 11 => 'Eleventh', 12 => 'Twelfth', 13 => 'Thirteenth', 14 => 'Fourteenth', 15 => 'Double Octave' }[self % 16] end |