module BunnyPublisher::Mandatory::ClassMethods

Attributes

on_message_return_callback[R]

Public Instance Methods

after_republish(*filters, &blk) click to toggle source
# File lib/bunny_publisher/mandatory.rb, line 26
def after_republish(*filters, &blk)
  set_callback(:republish, :after, *filters, &blk)
end
around_republish(*filters, &blk) click to toggle source
# File lib/bunny_publisher/mandatory.rb, line 22
def around_republish(*filters, &blk)
  set_callback(:republish, :around, *filters, &blk)
end
before_republish(*filters, &blk) click to toggle source
# 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) click to toggle source
# File lib/bunny_publisher/mandatory.rb, line 30
def on_message_return(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