Class: LibSL::LLSequenceNumber
- Inherits:
-
Object
- Object
- LibSL::LLSequenceNumber
- Defined in:
- lib/types.rb
Instance Attribute Summary collapse
-
#number ⇒ Object
Returns the value of attribute number.
Class Method Summary collapse
Instance Method Summary collapse
- #encode ⇒ Object
- #inc ⇒ Object
-
#initialize(num) ⇒ LLSequenceNumber
constructor
A new instance of LLSequenceNumber.
Constructor Details
#initialize(num) ⇒ LLSequenceNumber
Returns a new instance of LLSequenceNumber.
58 59 60 |
# File 'lib/types.rb', line 58 def initialize(num) @number = num end |
Instance Attribute Details
#number ⇒ Object
Returns the value of attribute number.
57 58 59 |
# File 'lib/types.rb', line 57 def number @number end |
Class Method Details
.decode(data) ⇒ Object
48 49 50 51 |
# File 'lib/types.rb', line 48 def self.decode(data) data = data.unpack('N1a*') return self.new(data[0]), data[1] end |
Instance Method Details
#encode ⇒ Object
53 54 55 |
# File 'lib/types.rb', line 53 def encode() [@number].pack('N') end |
#inc ⇒ Object
62 63 64 65 |
# File 'lib/types.rb', line 62 def inc() @number += 1 @number end |