Class: OSC::Bundle
- Extended by:
- Forwardable
- Includes:
- Enumerable
- Defined in:
- lib/osc.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.
245 246 247 248 |
# File 'lib/osc.rb', line 245 def initialize(=nil, *args) @timetag = @args = args end |
Instance Attribute Details
#timetag ⇒ Object
Returns the value of attribute timetag.
250 251 252 |
# File 'lib/osc.rb', line 250 def @timetag end |
Instance Method Details
#encode ⇒ Object
252 253 254 255 256 257 |
# File 'lib/osc.rb', line 252 def encode() s = OSCString.new('#bundle').encode s << (@timetag) s << @args.collect{|x| x2 = x.encode; [x2.size].pack('N') + x2}.join end |
#to_a ⇒ Object
262 |
# File 'lib/osc.rb', line 262 def to_a() @args.collect{|x| x.to_a} end |