class Alda::Raw

A special event that contains raw Alda codes. This is a walkaround for the absence of alda-code function in Alda 2 (alda-lang/alda#379). You can use Alda::EventList#raw to add an Alda::Raw event to the event list.

Attributes

contents[RW]

The raw Alda codes.

Public Class Methods

new(code) → Alda::Raw click to toggle source

Creates an Alda::Raw.

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

Public Instance Methods

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

Overrides Alda::Event#==. Returns true if other is an Alda::Raw and has the same contents as raw (using ==).

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

Overrides Alda::Event#to_alda_code.

# File lib/alda-rb/event.rb, line 1361
def to_alda_code
  @contents
end