Class: Alda::Cram
- Includes:
- EventList
- Defined in:
- lib/alda-rb/event.rb
Overview
Instance Attribute Summary collapse
-
#duration ⇒ Object
The string representing the duration of the CRAM.
Attributes included from EventList
Attributes inherited from Event
Instance Method Summary collapse
-
#==(other) ⇒ Object
:call-seq: cram == other -> true or false.
-
#initialize(duration, &block) ⇒ Cram
constructor
There is an event list sugar invoking this method, see Alda::EventList#method_missing.
-
#to_alda_code ⇒ Object
:call-seq: to_alda_code() -> String.
Methods included from EventList
#events_alda_codes, #has_variable?, #import, #method_missing, #on_contained, #to_a
Methods inherited from Event
#detach_from_parent, #is_event_of?, #on_contained
Constructor Details
#initialize(duration, &block) ⇒ Cram
974 975 976 977 |
# File 'lib/alda-rb/event.rb', line 974 def initialize duration, &block @duration = duration super &block end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Alda::EventList
Instance Attribute Details
#duration ⇒ Object
The string representing the duration of the CRAM.
965 966 967 |
# File 'lib/alda-rb/event.rb', line 965 def duration @duration end |
Instance Method Details
#==(other) ⇒ Object
:call-seq:
cram == other -> true or false
Overrides Alda::EventList#==. Returns true if the super method returns true and other
has the same #duration as cram
(using ==
).
995 996 997 |
# File 'lib/alda-rb/event.rb', line 995 def == other super && @duration == other.duration end |
#to_alda_code ⇒ Object
:call-seq:
to_alda_code() -> String
Overrides Alda::Event#to_alda_code.
984 985 986 |
# File 'lib/alda-rb/event.rb', line 984 def to_alda_code "{#{events_alda_codes}}#@duration" end |