Object
# File lib/celluloid/handlers.rb, line 5 def initialize @handlers = Set.new end
# File lib/celluloid/handlers.rb, line 9 def handle(*patterns, &block) patterns.each do |pattern| handler = Handler.new pattern, block @handlers << handler end end
Handle incoming messages
# File lib/celluloid/handlers.rb, line 17 def handle_message(message) if handler = @handlers.find { |h| h.match(message) } handler.call message handler end end
[Validate]
Generated with the Darkfish Rdoc Generator 2.