Class: Musa::MusicXML::Builder::Internal::Clef
- Inherits:
-
Object
- Object
- Musa::MusicXML::Builder::Internal::Clef
- Includes:
- Helper::ToXML
- Defined in:
- lib/musa-dsl/musicxml/builder/attributes.rb
Instance Attribute Summary collapse
-
#line ⇒ Object
Returns the value of attribute line.
-
#number ⇒ Object
readonly
Returns the value of attribute number.
-
#octave_change ⇒ Object
Returns the value of attribute octave_change.
-
#sign ⇒ Object
Returns the value of attribute sign.
Instance Method Summary collapse
- #_to_xml(io, indent:, tabs:) ⇒ Object
-
#initialize(number = nil, sign:, line:, octave_change: nil) ⇒ Clef
constructor
A new instance of Clef.
Methods included from Helper::ToXML
Constructor Details
#initialize(number = nil, sign:, line:, octave_change: nil) ⇒ Clef
Returns a new instance of Clef.
77 78 79 80 81 82 |
# File 'lib/musa-dsl/musicxml/builder/attributes.rb', line 77 def initialize(number = nil, sign:, line:, octave_change: nil) @number = number @sign = sign @line = line @octave_change = octave_change end |
Instance Attribute Details
#line ⇒ Object
Returns the value of attribute line.
85 86 87 |
# File 'lib/musa-dsl/musicxml/builder/attributes.rb', line 85 def line @line end |
#number ⇒ Object (readonly)
Returns the value of attribute number.
84 85 86 |
# File 'lib/musa-dsl/musicxml/builder/attributes.rb', line 84 def number @number end |
#octave_change ⇒ Object
Returns the value of attribute octave_change.
85 86 87 |
# File 'lib/musa-dsl/musicxml/builder/attributes.rb', line 85 def octave_change @octave_change end |
#sign ⇒ Object
Returns the value of attribute sign.
85 86 87 |
# File 'lib/musa-dsl/musicxml/builder/attributes.rb', line 85 def sign @sign end |
Instance Method Details
#_to_xml(io, indent:, tabs:) ⇒ Object
87 88 89 90 91 92 93 94 95 |
# File 'lib/musa-dsl/musicxml/builder/attributes.rb', line 87 def _to_xml(io, indent:, tabs:) io.puts "#{tabs}<clef#{" number=\"#{@number.to_i}\"" if @number}>" io.puts "#{tabs}\t<sign>#{@sign}</sign>" io.puts "#{tabs}\t<line>#{@line.to_i}</line>" if @line io.puts "#{tabs}\t<clef-octave-change>#{@octave_change.to_i}</clef-octave-change>" if @octave_change io.puts "#{tabs}</clef>" end |