Class: LibSL::LLVariable2

Inherits:
LLVariable1 show all
Defined in:
lib/types.rb

Instance Attribute Summary

Attributes inherited from LLVariable1

#data

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from LLVariable1

#initialize

Constructor Details

This class inherits a constructor from LibSL::LLVariable1

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

#encodeObject



121
122
123
# File 'lib/types.rb', line 121

def encode()
	[@data.length, @data].pack('n1a*')
end