Class: OSC::Bundle

Inherits:
Object
  • Object
show all
Defined in:
lib/osc-ruby/bundle.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(timetag = nil, *args) ⇒ Bundle

Returns a new instance of Bundle.



5
6
7
8
# File 'lib/osc-ruby/bundle.rb', line 5

def initialize(timetag=nil, *args)
  @timetag = timetag
  @args = args
end

Instance Attribute Details

#timetagObject

Returns the value of attribute timetag.



3
4
5
# File 'lib/osc-ruby/bundle.rb', line 3

def timetag
  @timetag
end

Instance Method Details

#encodeObject



10
11
12
13
14
15
16
# File 'lib/osc-ruby/bundle.rb', line 10

def encode()
  s = OSCString.new('#bundle').encode
  s << encode_timetag(@timetag)
  s << @args.collect do |x|
    x2 = x.encode; [x2.size].pack('N') + x2
  end.join
end

#to_aObject



18
19
20
# File 'lib/osc-ruby/bundle.rb', line 18

def to_a
  @args.collect{|x| x.to_a}
end