Class: RubyVolt::DataType::Parameter

Inherits:
Complex show all
Defined in:
lib/ruby_volt/data_type/complex/parameter.rb

Class Method Summary collapse

Methods inherited from RubyVolt::DataType

classifyDataType, testpacking, voltDataType

Class Method Details

.pack(val) ⇒ Object



6
7
8
9
# File 'lib/ruby_volt/data_type/complex/parameter.rb', line 6

def pack(val)
  dataType = voltDataType(val)
  WireTypeInfo.pack(dataType) + dataType.pack(val)
end

.unpack(bytes) ⇒ Object



11
12
13
14
15
# File 'lib/ruby_volt/data_type/complex/parameter.rb', line 11

def unpack(bytes)
  if dataType = WireTypeInfo.unpack(bytes)
    dataType.unpack(bytes)
  end
end