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



378
379
380
381
382
383
384
385
386
387
388
# File 'lib/musa-dsl/musicxml/builder/direction.rb', line 378

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.



394
395
396
# File 'lib/musa-dsl/musicxml/builder/direction.rb', line 394

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