Class: LS4::HeartbeatResponse
- Inherits:
-
Object
- Object
- LS4::HeartbeatResponse
- Defined in:
- lib/ls4/service/heartbeat.rb
Instance Attribute Summary collapse
-
#sync_needed ⇒ Object
Returns the value of attribute sync_needed.
-
#term ⇒ Object
Returns the value of attribute term.
Instance Method Summary collapse
- #from_msgpack(obj) ⇒ Object
-
#initialize(term = nil, sync_needed = nil) ⇒ HeartbeatResponse
constructor
A new instance of HeartbeatResponse.
- #to_msgpack(out = '') ⇒ Object
Constructor Details
#initialize(term = nil, sync_needed = nil) ⇒ HeartbeatResponse
Returns a new instance of HeartbeatResponse.
22 23 24 25 |
# File 'lib/ls4/service/heartbeat.rb', line 22 def initialize(term=nil, sync_needed=nil) @term = term @sync_needed = sync_needed end |
Instance Attribute Details
#sync_needed ⇒ Object
Returns the value of attribute sync_needed.
28 29 30 |
# File 'lib/ls4/service/heartbeat.rb', line 28 def sync_needed @sync_needed end |
#term ⇒ Object
Returns the value of attribute term.
27 28 29 |
# File 'lib/ls4/service/heartbeat.rb', line 27 def term @term end |
Instance Method Details
#from_msgpack(obj) ⇒ Object
34 35 36 37 38 |
# File 'lib/ls4/service/heartbeat.rb', line 34 def from_msgpack(obj) @term = obj[0] @sync_needed = obj[1] self end |
#to_msgpack(out = '') ⇒ Object
31 32 33 |
# File 'lib/ls4/service/heartbeat.rb', line 31 def to_msgpack(out = '') [@term, @sync_needed].to_msgpack(out) end |