Class: OSC::Bundle

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Packet

decode

Constructor Details

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

Returns a new instance of Bundle.



7
8
9
10
# File 'lib/osc-ruby/bundle.rb', line 7

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

Instance Attribute Details

#timetagObject

Returns the value of attribute timetag.



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

def timetag
  @timetag
end

Instance Method Details

#encodeObject



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

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



21
# File 'lib/osc-ruby/bundle.rb', line 21

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