Class: Alda::Marker
Overview
Instance Attribute Summary collapse
-
#name ⇒ Object
The marker’s name.
Attributes inherited from Event
Instance Method Summary collapse
-
#==(other) ⇒ Object
:call-seq: marker == other -> true or false.
-
#initialize(name) ⇒ Marker
constructor
:call-seq: new(name) -> Alda::Marker.
-
#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) ⇒ Marker
:call-seq:
new(name) -> Alda::Marker
Creates an Alda::Marker.
Underlines in name
is converted to hyphens.
1023 1024 1025 1026 |
# File 'lib/alda-rb/event.rb', line 1023 def initialize name super() @name = Alda::Utils.snake_to_slug name end |
Instance Attribute Details
#name ⇒ Object
The marker’s name
1014 1015 1016 |
# File 'lib/alda-rb/event.rb', line 1014 def name @name end |
Instance Method Details
#==(other) ⇒ Object
:call-seq:
marker == other -> true or false
Overrides Alda::Event#==. Returns true if other
is an Alda::Marker and has the same #name as marker
(using ==
).
1044 1045 1046 |
# File 'lib/alda-rb/event.rb', line 1044 def == other super || other.is_a?(Alda::Marker) && @name == other.name end |
#to_alda_code ⇒ Object
:call-seq:
to_alda_code() -> String
Overrides Alda::Event#to_alda_code.
1033 1034 1035 |
# File 'lib/alda-rb/event.rb', line 1033 def to_alda_code ?% + @name end |