Class: LibSL::LLU16

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

Instance Attribute Summary

Attributes inherited from LLNumber

#value

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from LLNumber

endianness, #initialize

Constructor Details

This class inherits a constructor from LibSL::LLNumber

Class Method Details

.decode(data) ⇒ Object



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

def self.decode(data)
	LLNumber.decode(data, 'v1a*', LLU16)
end

Instance Method Details

#encodeObject

Raises:

  • (ArgumentError)


168
169
170
171
# File 'lib/types.rb', line 168

def encode()
	raise ArgumentError, "Value out of range: #{@value}" if @value < 0 or @value > 0xffff
	super('v1')
end