Class: LS4::ObjectKey

Inherits:
Object
  • Object
show all
Defined in:
lib/ls4/logic/okey.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key = nil, vtime = nil, rsid = nil) ⇒ ObjectKey

Returns a new instance of ObjectKey.



22
23
24
25
26
# File 'lib/ls4/logic/okey.rb', line 22

def initialize(key=nil, vtime=nil, rsid=nil)
	@key = key
	@vtime = vtime.to_i
	@rsid = rsid.to_i
end

Instance Attribute Details

#keyObject (readonly)

Returns the value of attribute key.



28
29
30
# File 'lib/ls4/logic/okey.rb', line 28

def key
  @key
end

#rsidObject (readonly)

Returns the value of attribute rsid.



30
31
32
# File 'lib/ls4/logic/okey.rb', line 30

def rsid
  @rsid
end

#vtimeObject (readonly)

Returns the value of attribute vtime.



29
30
31
# File 'lib/ls4/logic/okey.rb', line 29

def vtime
  @vtime
end

Instance Method Details

#from_msgpack(obj) ⇒ Object



36
37
38
39
40
41
# File 'lib/ls4/logic/okey.rb', line 36

def from_msgpack(obj)
	@key = obj[0]
	@vtime = obj[1].to_i
	@rsid = obj[2].to_i
	self
end

#to_msgpack(out = '') ⇒ Object



32
33
34
# File 'lib/ls4/logic/okey.rb', line 32

def to_msgpack(out = '')
	[@key, @vtime, @rsid].to_msgpack(out)
end