Class: Musa::MusicXML::Builder::Internal::Forward
- Inherits:
-
Object
- Object
- Musa::MusicXML::Builder::Internal::Forward
- Includes:
- Helper::ToXML
- Defined in:
- lib/musa-dsl/musicxml/builder/backup-forward.rb
Instance Attribute Summary collapse
-
#duration ⇒ Object
Returns the value of attribute duration.
-
#staff ⇒ Object
Returns the value of attribute staff.
-
#voice ⇒ Object
Returns the value of attribute voice.
Instance Method Summary collapse
- #_to_xml(io, indent:, tabs:) ⇒ Object
-
#initialize(duration, voice: nil, staff: nil) ⇒ Forward
constructor
A new instance of Forward.
Methods included from Helper::ToXML
Constructor Details
#initialize(duration, voice: nil, staff: nil) ⇒ Forward
Returns a new instance of Forward.
24 25 26 27 28 |
# File 'lib/musa-dsl/musicxml/builder/backup-forward.rb', line 24 def initialize(duration, voice: nil, staff: nil) @duration = duration @voice = voice @staff = staff end |
Instance Attribute Details
#duration ⇒ Object
Returns the value of attribute duration.
30 31 32 |
# File 'lib/musa-dsl/musicxml/builder/backup-forward.rb', line 30 def duration @duration end |
#staff ⇒ Object
Returns the value of attribute staff.
30 31 32 |
# File 'lib/musa-dsl/musicxml/builder/backup-forward.rb', line 30 def staff @staff end |
#voice ⇒ Object
Returns the value of attribute voice.
30 31 32 |
# File 'lib/musa-dsl/musicxml/builder/backup-forward.rb', line 30 def voice @voice end |
Instance Method Details
#_to_xml(io, indent:, tabs:) ⇒ Object
32 33 34 35 36 37 38 39 40 |
# File 'lib/musa-dsl/musicxml/builder/backup-forward.rb', line 32 def _to_xml(io, indent:, tabs:) io.puts "#{tabs}<forward>" io.puts "#{tabs}\t<duration>#{@duration.to_i}</duration>" io.puts "#{tabs}\t<voice>#{@voice.to_i}</voice>" if @voice io.puts "#{tabs}\t<staff>#{@staff.to_i}</staff>" if @staff io.puts "#{tabs}</forward>" end |