Module: BunnyPublisher::Mandatory::ClassMethods
- Defined in:
- lib/bunny_publisher/mandatory.rb
Instance Attribute Summary collapse
-
#on_message_return_callback ⇒ Object
readonly
Returns the value of attribute on_message_return_callback.
Instance Method Summary collapse
- #after_republish(*filters, &blk) ⇒ Object
- #around_republish(*filters, &blk) ⇒ Object
- #before_republish(*filters, &blk) ⇒ Object
- #on_message_return(method_or_proc) ⇒ Object
Instance Attribute Details
#on_message_return_callback ⇒ Object (readonly)
Returns the value of attribute on_message_return_callback.
16 17 18 |
# File 'lib/bunny_publisher/mandatory.rb', line 16 def @on_message_return_callback end |
Instance Method Details
#after_republish(*filters, &blk) ⇒ Object
26 27 28 |
# File 'lib/bunny_publisher/mandatory.rb', line 26 def after_republish(*filters, &blk) set_callback(:republish, :after, *filters, &blk) end |
#around_republish(*filters, &blk) ⇒ Object
22 23 24 |
# File 'lib/bunny_publisher/mandatory.rb', line 22 def around_republish(*filters, &blk) set_callback(:republish, :around, *filters, &blk) end |
#before_republish(*filters, &blk) ⇒ Object
18 19 20 |
# File 'lib/bunny_publisher/mandatory.rb', line 18 def before_republish(*filters, &blk) set_callback(:republish, :before, *filters, &blk) end |
#on_message_return(method_or_proc) ⇒ Object
30 31 32 33 34 35 36 |
# File 'lib/bunny_publisher/mandatory.rb', line 30 def (method_or_proc) unless method_or_proc.is_a?(Proc) || method_or_proc.is_a?(Symbol) raise ArgumentError, "Method or Proc expected, #{method_or_proc.class} given" end @on_message_return_callback = method_or_proc end |