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



209
210
211
212
213
# File 'lib/consumer/consumer.rb', line 209

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

  handler_registry.register(handler)
end

#handler_registryObject



216
217
218
# File 'lib/consumer/consumer.rb', line 216

def handler_registry
  @handler_registry ||= HandlerRegistry.new
end