Class: LS4::HeartbeatResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/ls4/service/heartbeat.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_neededObject

Returns the value of attribute sync_needed.



28
29
30
# File 'lib/ls4/service/heartbeat.rb', line 28

def sync_needed
  @sync_needed
end

#termObject

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