Class: OSC::Bundle

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
Enumerable
Defined in:
lib/osc.rb

Overview

bundle of messages and/or bundles

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

New bundle with time and messages



172
173
174
175
176
177
178
179
180
181
# File 'lib/osc.rb', line 172

def initialize(t=nil, *args)
  @timetag = 
	case t
	when TimeTag
	  t
	else
	  TimeTag.new(t)
	end
  @args = args
end

Instance Attribute Details

#argsObject Also known as: messages, contents, to_a

Returns the value of attribute args.



164
165
166
# File 'lib/osc.rb', line 164

def args
  @args
end

#sourceObject

Returns the value of attribute source.



165
166
167
# File 'lib/osc.rb', line 165

def source
  @source
end

#timetagObject Also known as: timestamp

Returns the value of attribute timetag.



163
164
165
# File 'lib/osc.rb', line 163

def timetag
  @timetag
end

Instance Method Details

#encodeObject



198
199
200
# File 'lib/osc.rb', line 198

def encode
  Packet.encode(self)
end

#to_yamlObject



183
184
185
# File 'lib/osc.rb', line 183

def to_yaml
  {'timestamp'=>timetag, 'contents'=>contents}.to_yaml
end