Class: Musa::MusicXML::Builder::Internal::Measure
- Inherits:
-
Object
- Object
- Musa::MusicXML::Builder::Internal::Measure
- Extended by:
- Extension::AttributeBuilder
- Includes:
- Extension::With, Helper::ToXML
- Defined in:
- lib/musa-dsl/musicxml/builder/measure.rb
Instance Attribute Summary collapse
-
#elements ⇒ Object
readonly
Returns the value of attribute elements.
-
#number ⇒ Object
Returns the value of attribute number.
Instance Method Summary collapse
- #_to_xml(io, indent:, tabs:) ⇒ Object
-
#initialize(number, divisions: nil, key_cancel: nil, key_fifths: nil, key_mode: nil, time_senza_misura: nil, time_beats: nil, time_beat_type: nil, clef_sign: nil, clef_line: nil, clef_octave_change: nil, &block) ⇒ Measure
constructor
A new instance of Measure.
Methods included from Extension::AttributeBuilder
attr_complex_adder_to_array, attr_complex_adder_to_custom, attr_complex_builder, attr_simple_builder, attr_tuple_adder_to_array, attr_tuple_adder_to_hash, attr_tuple_builder
Methods included from Helper::ToXML
Methods included from Extension::With
Constructor Details
#initialize(number, divisions: nil, key_cancel: nil, key_fifths: nil, key_mode: nil, time_senza_misura: nil, time_beats: nil, time_beat_type: nil, clef_sign: nil, clef_line: nil, clef_octave_change: nil, &block) ⇒ Measure
Returns a new instance of Measure.
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/musa-dsl/musicxml/builder/measure.rb', line 22 def initialize(number, divisions: nil, key_cancel: nil, key_fifths: nil, key_mode: nil, time_senza_misura: nil, time_beats: nil, time_beat_type: nil, clef_sign: nil, clef_line: nil, clef_octave_change: nil, &block) @number = number @elements = [] @attributes = [] if divisions || key_cancel || key_fifths || key_mode || time_senza_misura || time_beats || time_beat_type || clef_sign || clef_line || clef_octave_change add_attributes divisions: divisions, key_cancel: key_cancel, key_fifths: key_fifths, key_mode: key_mode, time_senza_misura: time_senza_misura, time_beats: time_beats, time_beat_type: time_beat_type, clef_sign: clef_sign, clef_line: clef_line, clef_octave_change: clef_octave_change end with &block if block_given? end |
Instance Attribute Details
#elements ⇒ Object (readonly)
Returns the value of attribute elements.
48 49 50 |
# File 'lib/musa-dsl/musicxml/builder/measure.rb', line 48 def elements @elements end |
#number ⇒ Object
Returns the value of attribute number.
47 48 49 |
# File 'lib/musa-dsl/musicxml/builder/measure.rb', line 47 def number @number end |
Instance Method Details
#_to_xml(io, indent:, tabs:) ⇒ Object
124 125 126 127 128 129 130 131 132 |
# File 'lib/musa-dsl/musicxml/builder/measure.rb', line 124 def _to_xml(io, indent:, tabs:) io.puts "#{tabs}<measure number=\"#{@number.to_i}\">" @elements.each do |element| element.to_xml(io, indent: indent + 1) end io.puts "#{tabs}</measure>" end |