Class: Alda::Voice
Overview
Instance Attribute Summary collapse
-
#num ⇒ Object
The string representing the voice’s number.
Attributes inherited from Event
Instance Method Summary collapse
-
#==(other) ⇒ Object
:call-seq: voice == other -> true or false.
-
#initialize(num) ⇒ Voice
constructor
:call-seq: new(num) -> Alda::Voice.
-
#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(num) ⇒ Voice
:call-seq:
new(num) -> Alda::Voice
Creates an Alda::Voice.
920 921 922 923 |
# File 'lib/alda-rb/event.rb', line 920 def initialize num super() @num = num end |
Instance Attribute Details
#num ⇒ Object
The string representing the voice’s number.
913 914 915 |
# File 'lib/alda-rb/event.rb', line 913 def num @num end |
Instance Method Details
#==(other) ⇒ Object
:call-seq:
voice == other -> true or false
Overrides Alda::Event#==. Returns true if other
is an Alda::Voice and has the same #num as voice
(using ==
).
941 942 943 |
# File 'lib/alda-rb/event.rb', line 941 def == other super || other.is_a?(Alda::Voice) && @num == other.num end |
#to_alda_code ⇒ Object
:call-seq:
to_alda_code() -> String
Overrides Alda::Event#to_alda_code.
930 931 932 |
# File 'lib/alda-rb/event.rb', line 930 def to_alda_code ?V + num + ?: end |