Class: Stretto::MusicElements::LayerChange
- Inherits:
-
MusicElement
- Object
- MusicElement
- Stretto::MusicElements::LayerChange
- Defined in:
- lib/stretto/music_elements/layer_change.rb
Constant Summary
- MAX_LAYERS =
15
Instance Attribute Summary (collapse)
-
- (Object) index
Returns the value of attribute index.
Attributes inherited from MusicElement
Attributes included from Node
Instance Method Summary (collapse)
-
- (LayerChange) initialize(string_or_options, pattern = nil)
constructor
A new instance of LayerChange.
- - (Object) substitute_variables!
Methods inherited from MusicElement
#build_music_string, #duration, #end_of_tie?, #start_of_tie?, #to_s
Constructor Details
- (LayerChange) initialize(string_or_options, pattern = nil)
A new instance of LayerChange
12 13 14 15 16 17 18 19 |
# File 'lib/stretto/music_elements/layer_change.rb', line 12 def initialize(, pattern = nil) token = case when String then Stretto::Parser.parse_layer_change!() else end super(token[:text_value], pattern) @original_value = token[:value] end |
Instance Attribute Details
- (Object) index
Returns the value of attribute index
10 11 12 |
# File 'lib/stretto/music_elements/layer_change.rb', line 10 def index @index || @original_value.to_i(@pattern) end |
Instance Method Details
- (Object) substitute_variables!
32 33 34 |
# File 'lib/stretto/music_elements/layer_change.rb', line 32 def substitute_variables! self.index = index end |