Class: Measure
Instance Method Summary collapse
-
#initialize(chords = [], metas = []) ⇒ Measure
constructor
A new instance of Measure.
- #inspect(key = nil) ⇒ Object
- #set_meta(meta_event) ⇒ Object
Constructor Details
#initialize(chords = [], metas = []) ⇒ Measure
Returns a new instance of Measure.
4 5 6 7 |
# File 'lib/kuromusic/Track/Measure.rb', line 4 def initialize(chords = [], = []) @chords = chords @metas = end |
Instance Method Details
#inspect(key = nil) ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/kuromusic/Track/Measure.rb', line 19 def inspect(key = nil) " Measure Meta: " + @metas.map{|m| " " + m.inspect + "\n"}.join() + " ( " + @chords.map{|m| m.inspect(key)}.join("\n ),\n (\n ") + " )" end |
#set_meta(meta_event) ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/kuromusic/Track/Measure.rb', line 9 def () if .class.to_s != "Event" self.error_puts("ArgumentTypeError", "undefined method `+'") elsif .args[:type] != Event::EventType::META self.error_puts("EventTypeError", "undefined method `+'") end @metas.push() self end |