Class: Musa::MusicXML::Builder::Internal::Dynamics

Inherits:
DirectionType
  • Object
show all
Defined in:
lib/musa-dsl/musicxml/builder/direction.rb

Instance Method Summary collapse

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

#to_xml

Methods included from Extension::With

#with

Constructor Details

#initialize(value, &block) ⇒ Dynamics

pp / ppp / … or array of



145
146
147
148
149
# File 'lib/musa-dsl/musicxml/builder/direction.rb', line 145

def initialize(value, # pp / ppp / ... or array of
               &block)
  @dynamics = value.arrayfy
  super
end

Instance Method Details

#_direction_type_to_xml(io, indent:, tabs:) ⇒ Object



153
154
155
156
157
158
159
160
161
# File 'lib/musa-dsl/musicxml/builder/direction.rb', line 153

def _direction_type_to_xml(io, indent:, tabs:)
  io.puts "#{tabs}<dynamics>"

  @dynamics.each do |dynamics|
    io.puts "#{tabs}\t<#{dynamics} />"
  end

  io.puts "#{tabs}</dynamics>"
end