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



139
140
141
142
143
# File 'lib/consumer/consumer.rb', line 139

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

  handler_registry.register(handler)
end

#handler_registryObject



146
147
148
# File 'lib/consumer/consumer.rb', line 146

def handler_registry
  @handler_registry ||= HandlerRegistry.new
end