Class: Musa::MusicXML::Builder::Internal::Words Private

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

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Text words direction type.

Represents textual performance instructions or expressions. Can contain multiple text strings.

Examples:

Single text

measure.direction { words 'Allegro' }

Multiple texts

measure.direction { words ['con', 'brio'] }

Instance Method Summary collapse

Constructor Details

#initialize(value, &block) ⇒ Words

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

string | Array of string



435
436
437
438
439
440
441
# File 'lib/musa-dsl/musicxml/builder/direction.rb', line 435

def initialize(value, # string | Array of string
               &block)

  @words = value.arrayfy

  super
end

Instance Method Details

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

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



445
446
447
448
449
# File 'lib/musa-dsl/musicxml/builder/direction.rb', line 445

def _direction_type_to_xml(io, indent:, tabs:)
  @words.each do |words|
    io.puts "#{tabs}<words>#{words}</words>"
  end
end