Sha256: 1cf3bc8d4e2499cecf4b66f029b7b24a3438c2ee53c5b35d96b2c00be06c70cd
Contents?: true
Size: 478 Bytes
Versions: 7
Compression:
Stored size: 478 Bytes
Contents
module Jackhammer # An object meant to be instantiated once but used on each payload received # via the #call method class MessageReceiver attr_reader :handler_class def initialize(handler_class) @handler_class = handler_class end def call(message) handler = Object.const_get(handler_class) if handler.respond_to?(:perform_async) handler.perform_async message else handler.call message end end end end
Version data entries
7 entries across 7 versions & 1 rubygems