Class: HeadMusic::Analysis::DiatonicInterval::Category
- Inherits:
-
Object
- Object
- HeadMusic::Analysis::DiatonicInterval::Category
- Defined in:
- lib/head_music/analysis/diatonic_interval/category.rb
Overview
Accepts the letter name count between two notes and categorizes the interval
Instance Attribute Summary collapse
-
#number ⇒ Object
readonly
Returns the value of attribute number.
Instance Method Summary collapse
-
#initialize(number) ⇒ Category
constructor
A new instance of Category.
- #large_leap? ⇒ Boolean
- #leap? ⇒ Boolean
- #skip? ⇒ Boolean
- #step? ⇒ Boolean
Constructor Details
#initialize(number) ⇒ Category
Returns a new instance of Category.
5 6 7 |
# File 'lib/head_music/analysis/diatonic_interval/category.rb', line 5 def initialize(number) @number = number end |
Instance Attribute Details
#number ⇒ Object (readonly)
Returns the value of attribute number.
3 4 5 |
# File 'lib/head_music/analysis/diatonic_interval/category.rb', line 3 def number @number end |
Instance Method Details
#large_leap? ⇒ Boolean
21 22 23 |
# File 'lib/head_music/analysis/diatonic_interval/category.rb', line 21 def large_leap? number > 3 end |
#leap? ⇒ Boolean
17 18 19 |
# File 'lib/head_music/analysis/diatonic_interval/category.rb', line 17 def leap? number >= 3 end |
#skip? ⇒ Boolean
13 14 15 |
# File 'lib/head_music/analysis/diatonic_interval/category.rb', line 13 def skip? number == 3 end |
#step? ⇒ Boolean
9 10 11 |
# File 'lib/head_music/analysis/diatonic_interval/category.rb', line 9 def step? number == 2 end |