Class: Celluloid::Cell::ExitHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/celluloid/cell.rb

Instance Method Summary collapse

Constructor Details

#initialize(behavior, subject, method_name) ⇒ ExitHandler

Returns a new instance of ExitHandler.



7
8
9
10
11
# File 'lib/celluloid/cell.rb', line 7

def initialize(behavior, subject, method_name)
  @behavior = behavior
  @subject = subject
  @method_name = method_name
end

Instance Method Details

#call(event) ⇒ Object



13
14
15
16
17
# File 'lib/celluloid/cell.rb', line 13

def call(event)
  @behavior.task(:exit_handler, @method_name) do
    @subject.send(@method_name, event.actor, event.reason)
  end
end