Class: LibSL::LLVariable2
Instance Attribute Summary
Attributes inherited from LLVariable1
#data
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from LLVariable1
#initialize
Class Method Details
.decode(data) ⇒ Object
115
116
117
118
119
|
# File 'lib/types.rb', line 115
def self.decode(data)
data = data.unpack('n1a*')
data = data[1].unpack("a#{data[0]}a*")
return self.new(data[0]), data[1]
end
|
Instance Method Details
#encode ⇒ Object
121
122
123
|
# File 'lib/types.rb', line 121
def encode()
[@data.length, @data].pack('n1a*')
end
|