Class: OSC::Bundle
- Inherits:
-
Object
- Object
- OSC::Bundle
- 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
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(=nil, *args) @timetag = @args = args end |
Instance Attribute Details
#timetag ⇒ Object
Returns the value of attribute timetag.
3 4 5 |
# File 'lib/osc-ruby/bundle.rb', line 3 def @timetag end |
Instance Method Details
#encode ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/osc-ruby/bundle.rb', line 10 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
18 19 20 |
# File 'lib/osc-ruby/bundle.rb', line 18 def to_a @args.collect{|x| x.to_a} end |