Class: MusicalScore::Note::Type

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

Constant Summary collapse

@@size =
%w(
    128th
    64th
    32nd
    16th
    eighth
    quarter
    half
    whole
    breve
)

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from ElementBase

create_by_hash, create_by_xml

Constructor Details

#initialize(size) ⇒ Type

Returns a new instance of Type.



20
21
22
# File 'lib/musical_score/note/type.rb', line 20

def initialize(size)
    @size = size
end

Instance Attribute Details

#sizeObject (readonly)

Returns the value of attribute size.



18
19
20
# File 'lib/musical_score/note/type.rb', line 18

def size
  @size
end

Instance Method Details

#export_xmlObject



24
25
26
# File 'lib/musical_score/note/type.rb', line 24

def export_xml
    return REXML::Element.new('type').add_text(@size.to_s)
end