module Actor::Module::Handler

Public Class Methods

included(cls) click to toggle source
# File lib/actor/module/handler.rb, line 4
def self.included cls
  cls.class_exec do
    extend Macro
  end
end

Public Instance Methods

handle(message) click to toggle source
# File lib/actor/module/handler.rb, line 10
def handle message
  handler_method_name = MethodName.get message

  return unless handler_method_name and respond_to? handler_method_name

  handler_method = method handler_method_name

  if handler_method.arity == 0
    handler_method.()
  else
    handler_method.(message)
  end
end