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



199
200
201
202
203
# File 'lib/consumer/consumer.rb', line 199

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

  handler_registry.register(handler)
end

#handler_registryObject



206
207
208
# File 'lib/consumer/consumer.rb', line 206

def handler_registry
  @handler_registry ||= HandlerRegistry.new
end