Class: Musa::MusicXML::Builder::Internal::Bracket Private

Inherits:
DirectionType
  • Object
show all
Includes:
Helper
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.

Bracket direction type for analytical markings.

Represents brackets used for grouping or analytical notation. Supports different line types and end styles.

Examples:

Start bracket

measure.direction { bracket 'start', line_end: 'down', line_type: 'solid' }

Stop bracket

measure.direction { bracket 'stop', line_end: 'up' }

Instance Method Summary collapse

Constructor Details

#initialize(type, line_end:, line_type: nil, &block) ⇒ Bracket

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.

start / stop / continue



391
392
393
394
395
396
397
398
399
400
401
# File 'lib/musa-dsl/musicxml/builder/direction.rb', line 391

def initialize(type, # start / stop / continue
               line_end:, # up / down / both / arrow / none
               line_type: nil, # solid / dashed / dotted / wavy
               &block)

  @type = type
  @line_end = line_end
  @line_type = line_type

  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.



407
408
409
# File 'lib/musa-dsl/musicxml/builder/direction.rb', line 407

def _direction_type_to_xml(io, indent:, tabs:)
  io.puts "#{tabs}<bracket type=\"#{@type}\" line_end=\"#{@line_end}\"#{ decode_bool_or_string_attribute(@line_type, 'line_type') }/>"
end