Class: Celluloid::Internals::Handler
- Inherits:
-
Object
- Object
- Celluloid::Internals::Handler
- Defined in:
- lib/celluloid/internals/handlers.rb
Overview
Methods blocking on a call to receive
Instance Method Summary collapse
- #call(message) ⇒ Object
-
#initialize(pattern, block) ⇒ Handler
constructor
A new instance of Handler.
-
#match(message) ⇒ Object
Match a message with this receiver’s block.
Constructor Details
#initialize(pattern, block) ⇒ Handler
Returns a new instance of Handler.
27 28 29 30 |
# File 'lib/celluloid/internals/handlers.rb', line 27 def initialize(pattern, block) @pattern = pattern @block = block end |
Instance Method Details
#call(message) ⇒ Object
37 38 39 |
# File 'lib/celluloid/internals/handlers.rb', line 37 def call() @block.call end |
#match(message) ⇒ Object
Match a message with this receiver’s block
33 34 35 |
# File 'lib/celluloid/internals/handlers.rb', line 33 def match() @pattern === end |