Class: IRealB::Parser::ChordGrouping
- Inherits:
-
Object
- Object
- IRealB::Parser::ChordGrouping
- Defined in:
- lib/irealb/parser/chord_grouping.rb
Instance Attribute Summary collapse
-
#bars ⇒ Object
Returns the value of attribute bars.
-
#coda ⇒ Object
Returns the value of attribute coda.
-
#endings ⇒ Object
Returns the value of attribute endings.
-
#repeat ⇒ Object
Returns the value of attribute repeat.
-
#section ⇒ Object
Returns the value of attribute section.
-
#time ⇒ Object
Returns the value of attribute time.
Instance Method Summary collapse
- #as_json(options = {}) ⇒ Object
-
#initialize(attributes = {}) ⇒ ChordGrouping
constructor
A new instance of ChordGrouping.
Constructor Details
#initialize(attributes = {}) ⇒ ChordGrouping
Returns a new instance of ChordGrouping.
11 12 13 14 15 16 17 |
# File 'lib/irealb/parser/chord_grouping.rb', line 11 def initialize(attributes = {}) self. = [] attributes.each do |key, value| self.send("#{key}=", value) if respond_to?(key) end end |
Instance Attribute Details
#bars ⇒ Object
Returns the value of attribute bars.
7 8 9 |
# File 'lib/irealb/parser/chord_grouping.rb', line 7 def @bars end |
#coda ⇒ Object
Returns the value of attribute coda.
9 10 11 |
# File 'lib/irealb/parser/chord_grouping.rb', line 9 def coda @coda end |
#endings ⇒ Object
Returns the value of attribute endings.
8 9 10 |
# File 'lib/irealb/parser/chord_grouping.rb', line 8 def endings @endings end |
#repeat ⇒ Object
Returns the value of attribute repeat.
6 7 8 |
# File 'lib/irealb/parser/chord_grouping.rb', line 6 def repeat @repeat end |
#section ⇒ Object
Returns the value of attribute section.
4 5 6 |
# File 'lib/irealb/parser/chord_grouping.rb', line 4 def section @section end |
#time ⇒ Object
Returns the value of attribute time.
5 6 7 |
# File 'lib/irealb/parser/chord_grouping.rb', line 5 def time @time end |
Instance Method Details
#as_json(options = {}) ⇒ Object
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/irealb/parser/chord_grouping.rb', line 19 def as_json( = {}) { :section => section, :time => time, :repeat => repeat, :coda => coda, :bars => , :endings => endings }.reject {|k,v| v.nil? } end |