Class: OSC::Bundle
- Extended by:
- Forwardable
- Includes:
- Enumerable
- Defined in:
- lib/osc-ruby/bundle.rb
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.
17 18 19 20 |
# File 'lib/osc-ruby/bundle.rb', line 17 def initialize(=nil, *args) @timetag = @args = args end |
Instance Attribute Details
#timetag ⇒ Object
Returns the value of attribute timetag.
6 7 8 |
# File 'lib/osc-ruby/bundle.rb', line 6 def @timetag end |
Instance Method Details
#encode ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/osc-ruby/bundle.rb', line 22 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
31 |
# File 'lib/osc-ruby/bundle.rb', line 31 def to_a() @args.collect{|x| x.to_a} end |