Class: Zgomot::Comp::Scale
Instance Attribute Summary collapse
-
#intervals ⇒ Object
readonly
Returns the value of attribute intervals.
-
#scale ⇒ Object
readonly
Returns the value of attribute scale.
-
#shift ⇒ Object
readonly
Returns the value of attribute shift.
Instance Method Summary collapse
-
#initialize(int, shift) ⇒ Scale
constructor
A new instance of Scale.
- #method_missing(method, *args, &blk) ⇒ Object
- #next ⇒ Object
Constructor Details
#initialize(int, shift) ⇒ Scale
Returns a new instance of Scale.
7 8 9 10 11 12 |
# File 'lib/zgomot/comp/scale.rb', line 7 def initialize(int, shift) @intervals = int @shift = shift - 1 @scale = int.clone self.shift.times{self.next} end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &blk) ⇒ Object
18 19 20 |
# File 'lib/zgomot/comp/scale.rb', line 18 def method_missing(method, *args, &blk ) scale.send(method, *args, &blk) end |
Instance Attribute Details
#intervals ⇒ Object (readonly)
Returns the value of attribute intervals.
5 6 7 |
# File 'lib/zgomot/comp/scale.rb', line 5 def intervals @intervals end |
#scale ⇒ Object (readonly)
Returns the value of attribute scale.
5 6 7 |
# File 'lib/zgomot/comp/scale.rb', line 5 def scale @scale end |
#shift ⇒ Object (readonly)
Returns the value of attribute shift.
5 6 7 |
# File 'lib/zgomot/comp/scale.rb', line 5 def shift @shift end |
Instance Method Details
#next ⇒ Object
14 15 16 |
# File 'lib/zgomot/comp/scale.rb', line 14 def next scale.push(scale.shift) end |