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



156
157
158
159
160
# File 'lib/consumer/consumer.rb', line 156

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

  handler_registry.register(handler)
end

#handler_registryObject



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

def handler_registry
  @handler_registry ||= HandlerRegistry.new
end