Class: MusicalScore::Note::Notation::Tie

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from ElementBase

create_by_hash, create_by_xml

Constructor Details

#initialize(type) ⇒ Tie

Returns a new instance of Tie.



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

def initialize(type)
    @type = type.to_sym
end

Instance Attribute Details

#typeObject

Returns the value of attribute type.



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

def type
  @type
end

Instance Method Details

#export_xmlObject



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

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

    return tie_element
end