Class: OSC::Bundle
Instance Attribute Summary collapse
-
#timetag ⇒ Object
Returns the value of attribute timetag.
Instance Method Summary collapse
- #encode ⇒ Object
-
#initialize(timetag = nil, *args) ⇒ Bundle
constructor
A new instance of Bundle.
- #to_a ⇒ Object
Methods inherited from Packet
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(=nil, *args) @timetag = @args = args end |
Instance Attribute Details
#timetag ⇒ Object
Returns the value of attribute timetag.
5 6 7 |
# File 'lib/osc-ruby/bundle.rb', line 5 def @timetag end |
Instance Method Details
#encode ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/osc-ruby/bundle.rb', line 12 def encode() s = OSCString.new('#bundle').encode s << (@timetag) s << @args.collect do |x| x2 = x.encode; [x2.size].pack('N') + x2 end.join end |
#to_a ⇒ Object
21 |
# File 'lib/osc-ruby/bundle.rb', line 21 def to_a() @args.collect{|x| x.to_a} end |