Class: LibSL::LLVariable1

Inherits:
Object
  • Object
show all
Defined in:
lib/types.rb

Direct Known Subclasses

LLVariable2

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ LLVariable1

Returns a new instance of LLVariable1.



109
110
111
# File 'lib/types.rb', line 109

def initialize(data)
	@data = data
end

Instance Attribute Details

#dataObject

Returns the value of attribute data.



108
109
110
# File 'lib/types.rb', line 108

def data
  @data
end

Class Method Details

.decode(data) ⇒ Object



98
99
100
101
102
# File 'lib/types.rb', line 98

def self.decode(data)
	data = data.unpack('C1a*')
	data = data[1].unpack("a#{data[0]}a*")
	return self.new(data[0]), data[1]
end

Instance Method Details

#encodeObject



104
105
106
# File 'lib/types.rb', line 104

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