Class: LibSL::LLVariable1
- Inherits:
-
Object
- Object
- LibSL::LLVariable1
- Defined in:
- lib/types.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
Class Method Summary collapse
Instance Method Summary collapse
- #encode ⇒ Object
-
#initialize(data) ⇒ LLVariable1
constructor
A new instance of LLVariable1.
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
#data ⇒ Object
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
#encode ⇒ Object
104 105 106 |
# File 'lib/types.rb', line 104 def encode() [@data.length, @data].pack('C1a*') end |