Module: Consumer::HandlerMacro
- Defined in:
- lib/consumer/consumer.rb
Instance Method Summary collapse
- #handler_macro(handler = nil, &block) ⇒ Object (also: #handler)
- #handler_registry ⇒ Object
Instance Method Details
#handler_macro(handler = nil, &block) ⇒ Object Also known as: handler
210 211 212 213 214 |
# File 'lib/consumer/consumer.rb', line 210 def handler_macro(handler=nil, &block) handler ||= block handler_registry.register(handler) end |
#handler_registry ⇒ Object
217 218 219 |
# File 'lib/consumer/consumer.rb', line 217 def handler_registry @handler_registry ||= HandlerRegistry.new end |