Class: Musicality::SuperCollider::Bundle

Inherits:
Object
  • Object
show all
Defined in:
lib/musicality/performance/supercollider/bundle.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(time, *messages) ⇒ Bundle

Returns a new instance of Bundle.



6
7
8
9
# File 'lib/musicality/performance/supercollider/bundle.rb', line 6

def initialize time, *messages
  @time = time
  @messages = messages
end

Instance Attribute Details

#messagesObject (readonly)

Returns the value of attribute messages.



5
6
7
# File 'lib/musicality/performance/supercollider/bundle.rb', line 5

def messages
  @messages
end

#timeObject (readonly)

Returns the value of attribute time.



5
6
7
# File 'lib/musicality/performance/supercollider/bundle.rb', line 5

def time
  @time
end

Instance Method Details

#to_sclangObject



11
12
13
14
# File 'lib/musicality/performance/supercollider/bundle.rb', line 11

def to_sclang
  raise "Bundle contains no messages" if @messages.empty?
  "[ #{@time.to_f}, #{@messages.map {|m| m.to_sclang }.join(", ")} ]"
end