Class: Stretto::MusicElements::Rest
- Inherits:
-
MusicElement
- Object
- MusicElement
- Stretto::MusicElements::Rest
- Includes:
- Duration
- Defined in:
- lib/stretto/music_elements/rest.rb
Overview
Represents a rest.
Is represented by an “R”, followed by a duration modifier (see Duration)
Constant Summary
Constants included from Duration
Duration::DEFAULT_DURATION, Duration::DEFAULT_TUPLET_DENOMINATOR, Duration::DEFAULT_TUPLET_NUMERATOR, Duration::DURATIONS
Instance Attribute Summary collapse
-
#original_duration ⇒ Object
readonly
Returns the value of attribute original_duration.
Attributes included from Duration
Attributes inherited from MusicElement
Attributes included from Node
Instance Method Summary collapse
-
#initialize(string_or_options, pattern = nil) ⇒ Rest
constructor
A new instance of Rest.
Methods included from Duration
#build_duration_from_token, #duration, #end_of_tie?, parse_duration, #start_of_tie?, #tied_duration, #tied_elements
Methods inherited from MusicElement
#build_music_string, #duration, #end_of_tie?, #start_of_tie?, #substitute_variables!, #to_s
Constructor Details
#initialize(string_or_options, pattern = nil) ⇒ Rest
Returns a new instance of Rest.
15 16 17 18 19 20 21 22 |
# File 'lib/stretto/music_elements/rest.rb', line 15 def initialize(, pattern = nil) token = case when String then Stretto::Parser.parse_rest!() else end super(token[:text_value], pattern) build_duration_from_token(token[:duration]) end |
Instance Attribute Details
#original_duration ⇒ Object (readonly)
Returns the value of attribute original_duration.
13 14 15 |
# File 'lib/stretto/music_elements/rest.rb', line 13 def original_duration @original_duration end |