Class: Chordpro::Song
- Inherits:
-
Object
- Object
- Chordpro::Song
- Defined in:
- lib/chordpro/song.rb
Instance Attribute Summary collapse
-
#elements ⇒ Object
readonly
Returns the value of attribute elements.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
-
#initialize(elements = []) ⇒ Song
constructor
A new instance of Song.
- #method_missing(method, *args) ⇒ Object
- #respond_to_missing?(method, include_all = false) ⇒ Boolean
Constructor Details
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/chordpro/song.rb', line 14 def method_missing(method, *args) if respond_to_missing?(method) [method] else super end end |
Instance Attribute Details
#elements ⇒ Object (readonly)
Returns the value of attribute elements.
3 4 5 |
# File 'lib/chordpro/song.rb', line 3 def elements @elements end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
3 4 5 |
# File 'lib/chordpro/song.rb', line 3 def @metadata end |
Instance Method Details
#accept(visitor) ⇒ Object
10 11 12 |
# File 'lib/chordpro/song.rb', line 10 def accept(visitor) elements.map { |element| element.accept(visitor) } end |