Class: Alda::AtMarker
Overview
An at-marker event. An Alda::EventContainer containing an Alda::AtMarker can be created using event list sugar. See Alda::EventList#method_missing.
It should be used together with Alda::Marer. For examples, see Alda::Marker.
Instance Attribute Summary collapse
-
#name ⇒ Object
The corresponding marker’s name.
Attributes inherited from Event
Instance Method Summary collapse
-
#==(other) ⇒ Object
:call-seq: at_marker == other -> true or false.
-
#initialize(name) ⇒ AtMarker
constructor
:call-seq: new(name) -> Alda::AtMarker.
-
#to_alda_code ⇒ Object
:call-seq: to_alda_code() -> String.
Methods inherited from Event
#detach_from_parent, #is_event_of?, #on_contained
Constructor Details
#initialize(name) ⇒ AtMarker
:call-seq:
new(name) -> Alda::AtMarker
Creates an Alda::AtMarker.
Underlines “_” in name
is converted to hyphens “-”.
1069 1070 1071 1072 |
# File 'lib/alda-rb/event.rb', line 1069 def initialize name super() @name = Alda::Utils.snake_to_slug name end |
Instance Attribute Details
#name ⇒ Object
The corresponding marker’s name
1060 1061 1062 |
# File 'lib/alda-rb/event.rb', line 1060 def name @name end |
Instance Method Details
#==(other) ⇒ Object
:call-seq:
at_marker == other -> true or false
Overrides Alda::Event#==. Returns true if other
is an Alda::AtMarker and has the same #name as at_marker
(using ==
).
1090 1091 1092 |
# File 'lib/alda-rb/event.rb', line 1090 def == other super || other.is_a?(Alda::AtMarker) && @name == other.name end |
#to_alda_code ⇒ Object
:call-seq:
to_alda_code() -> String
Overrides Alda::Event#to_alda_code.
1079 1080 1081 |
# File 'lib/alda-rb/event.rb', line 1079 def to_alda_code ?@ + @name end |