class Bunny::ReturnInfo
Wraps AMQ::Protocol::Basic::Return to provide access to the delivery properties as immutable hash as well as methods.
Public Class Methods
Source
# File lib/bunny/return_info.rb, line 19 def initialize(basic_return) @basic_return = basic_return @hash = { :reply_code => basic_return.reply_code, :reply_text => basic_return.reply_text, :exchange => basic_return.exchange, :routing_key => basic_return.routing_key } end
API
Public Instance Methods
Source
# File lib/bunny/return_info.rb, line 37 def [](k) @hash[k] end
Accesses returned delivery properties by key @see Hash#[]
Source
# File lib/bunny/return_info.rb, line 31 def each(*args, &block) @hash.each(*args, &block) end
Iterates over the returned delivery properties @see Enumerable#each
Source
# File lib/bunny/return_info.rb, line 67 def exchange @basic_return.exchange end
@return [String] Exchange
the message was published to
Source
# File lib/bunny/return_info.rb, line 57 def reply_code @basic_return.reply_code end
@return [Integer] Reply (status) code of the cause
Source
# File lib/bunny/return_info.rb, line 62 def reply_text @basic_return.reply_text end
@return [Integer] Reply (status) text of the cause, explaining why the message was returned
Source
# File lib/bunny/return_info.rb, line 72 def routing_key @basic_return.routing_key end
@return [String] Routing key the message has
Source
# File lib/bunny/return_info.rb, line 42 def to_hash @hash end
@return [Hash] Hash representation of this returned delivery info