Class: MusicalScore::Note::Notation::Tuplet

Inherits:
ElementBase
  • Object
show all
Includes:
Contracts
Defined in:
lib/musical_score/note/notation/tuplet.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from ElementBase

create_by_hash, create_by_xml

Constructor Details

#initialize(type) ⇒ Tuplet

Returns a new instance of Tuplet.



9
10
11
# File 'lib/musical_score/note/notation/tuplet.rb', line 9

def initialize(type)
    @type = type
end

Instance Attribute Details

#typeObject

Returns the value of attribute type.



7
8
9
# File 'lib/musical_score/note/notation/tuplet.rb', line 7

def type
  @type
end

Instance Method Details

#export_xmlObject



13
14
15
16
17
18
# File 'lib/musical_score/note/notation/tuplet.rb', line 13

def export_xml
    tuplet_element = REXML::Element.new('tuplet')
    tuplet_element.add_attribute('type', @type.to_s)

    return tuplet_element
end