Class: Chordproko::ChordGroup
- Inherits:
-
Object
- Object
- Chordproko::ChordGroup
- Defined in:
- lib/chordproko/chord_group.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
Returns the value of attribute content.
-
#key ⇒ Object
Returns the value of attribute key.
Instance Method Summary collapse
- #each(&block) ⇒ Object
-
#initialize(content) ⇒ ChordGroup
constructor
A new instance of ChordGroup.
- #to_s ⇒ Object
Constructor Details
#initialize(content) ⇒ ChordGroup
Returns a new instance of ChordGroup.
4 5 6 7 |
# File 'lib/chordproko/chord_group.rb', line 4 def initialize content @content = content @key = 0 end |
Instance Attribute Details
#content ⇒ Object
Returns the value of attribute content.
3 4 5 |
# File 'lib/chordproko/chord_group.rb', line 3 def content @content end |
#key ⇒ Object
Returns the value of attribute key.
3 4 5 |
# File 'lib/chordproko/chord_group.rb', line 3 def key @key end |
Instance Method Details
#each(&block) ⇒ Object
8 9 10 |
# File 'lib/chordproko/chord_group.rb', line 8 def each(&block) [self].each(&block) end |
#to_s ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/chordproko/chord_group.rb', line 11 def to_s @content.each do |c| if c.class.to_s == "Chordproko::Chord" c.key = @key end c.to_s end.join end |