Class: LibSL::LLSequenceNumber

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#numberObject

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

#encodeObject



53
54
55
# File 'lib/types.rb', line 53

def encode()
	[@number].pack('N')
end

#incObject



62
63
64
65
# File 'lib/types.rb', line 62

def inc()
	@number += 1
	@number
end