Class: Musa::MusicXML::Builder::Internal::Forward

Inherits:
Object
  • Object
show all
Includes:
Helper::ToXML
Defined in:
lib/musa-dsl/musicxml/builder/backup-forward.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Helper::ToXML

#to_xml

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

#durationObject

Returns the value of attribute duration.



30
31
32
# File 'lib/musa-dsl/musicxml/builder/backup-forward.rb', line 30

def duration
  @duration
end

#staffObject

Returns the value of attribute staff.



30
31
32
# File 'lib/musa-dsl/musicxml/builder/backup-forward.rb', line 30

def staff
  @staff
end

#voiceObject

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