Module: Consumer::HandlerMacro

Defined in:
lib/consumer/consumer.rb

Instance Method Summary collapse

Instance Method Details

#handler_macro(handler = nil, &block) ⇒ Object Also known as: handler



161
162
163
164
165
# File 'lib/consumer/consumer.rb', line 161

def handler_macro(handler=nil, &block)
  handler ||= block

  handler_registry.register(handler)
end

#handler_registryObject



168
169
170
# File 'lib/consumer/consumer.rb', line 168

def handler_registry
  @handler_registry ||= HandlerRegistry.new
end