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
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_registry ⇒ Object
146 147 148 |
# File 'lib/consumer/consumer.rb', line 146 def handler_registry @handler_registry ||= HandlerRegistry.new end |