class Alda::GetVariable

A get-variable event. An Alda::EventContainer containing an Alda::GetVariable can be derived using event list sugar. See Alda::EventList#method_missing.

This can be ambiguous with Alda::SetVariable and Alda::InlineLisp. For examples, see Alda::SetVariable.

Attributes

name[RW]

The name of the variable.

Public Class Methods

new(name) → Alda::GetVariable click to toggle source

Creates an Alda::GetVariable.

Calls superclass method
# File lib/alda-rb/event.rb, line 1260
def initialize name
  super()
  @name = name
end

Public Instance Methods

get_variable == other → true or false click to toggle source

Overrides Alda::Event#==. Returns true if other is an Alda::GetVariable and has the same name as get_variable (using ==).

Calls superclass method Alda::Event#==
# File lib/alda-rb/event.rb, line 1281
def == other
  super || other.is_a?(Alda::GetVariable) && @name == other.name
end
to_alda_code() → String click to toggle source

Overrides Alda::Event#to_alda_code.

# File lib/alda-rb/event.rb, line 1270
def to_alda_code
  @name.to_s
end