Class: LS4::ObjectKey
- Inherits:
-
Object
- Object
- LS4::ObjectKey
- Defined in:
- lib/ls4/logic/okey.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#rsid ⇒ Object
readonly
Returns the value of attribute rsid.
-
#vtime ⇒ Object
readonly
Returns the value of attribute vtime.
Instance Method Summary collapse
- #from_msgpack(obj) ⇒ Object
-
#initialize(key = nil, vtime = nil, rsid = nil) ⇒ ObjectKey
constructor
A new instance of ObjectKey.
- #to_msgpack(out = '') ⇒ Object
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
#key ⇒ Object (readonly)
Returns the value of attribute key.
28 29 30 |
# File 'lib/ls4/logic/okey.rb', line 28 def key @key end |
#rsid ⇒ Object (readonly)
Returns the value of attribute rsid.
30 31 32 |
# File 'lib/ls4/logic/okey.rb', line 30 def rsid @rsid end |
#vtime ⇒ Object (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 |