Class: RSwim::Member::ForwardingState::ForwardingAck

Inherits:
Base
  • Object
show all
Defined in:
lib/rswim/member/forwarding_state/forwarding_ack.rb

Instance Method Summary collapse

Methods inherited from Base

#forward_ack_to_member

Constructor Details

#initialize(id, node_member_id) ⇒ ForwardingAck

Returns a new instance of ForwardingAck.



7
8
9
10
# File 'lib/rswim/member/forwarding_state/forwarding_ack.rb', line 7

def initialize(id, node_member_id)
  super
  @done = false
end

Instance Method Details

#advance(elapsed_seconds) ⇒ Object



18
19
20
21
22
# File 'lib/rswim/member/forwarding_state/forwarding_ack.rb', line 18

def advance(elapsed_seconds)
  if @done then Ready.new(@id, @node_member_id)
  else self
  end
end

#prepare_outputObject



12
13
14
15
16
# File 'lib/rswim/member/forwarding_state/forwarding_ack.rb', line 12

def prepare_output
  @done = true
  message = Message.new(@id, @node_member_id, :ack)
  [message]
end