class Bunny::GetResponse
Wraps {AMQ::Protocol::Basic::GetOk} to provide access to the delivery properties as immutable hash as well as methods.
Attributes
@return [Bunny::Channel] Channel
this basic.get-ok response is on
Public Class Methods
Source
# File lib/bunny/get_response.rb, line 25 def initialize(get_ok, channel) @get_ok = get_ok @hash = { :delivery_tag => @get_ok.delivery_tag, :redelivered => @get_ok.redelivered, :exchange => @get_ok.exchange, :routing_key => @get_ok.routing_key, :channel => channel } @channel = channel end
@private
Public Instance Methods
Source
# File lib/bunny/get_response.rb, line 45 def [](k) @hash[k] end
Accesses delivery properties by key @see Hash#[]
Source
# File lib/bunny/get_response.rb, line 65 def delivery_tag @get_ok.delivery_tag end
@return [String] Delivery identifier that is used to acknowledge, reject and nack deliveries
Source
# File lib/bunny/get_response.rb, line 39 def each(*args, &block) @hash.each(*args, &block) end
Iterates over the delivery properties @see Enumerable#each
Source
# File lib/bunny/get_response.rb, line 76 def exchange @get_ok.exchange end
@return [String] Name of the exchange this message was published to
Source
# File lib/bunny/get_response.rb, line 60 def inspect to_hash.inspect end
@private
Source
# File lib/bunny/get_response.rb, line 70 def redelivered @get_ok.redelivered end
@return [Boolean] true if this delivery is a redelivery (the message was requeued at least once)
Also aliased as: redelivered?
Source
# File lib/bunny/get_response.rb, line 81 def routing_key @get_ok.routing_key end
@return [String] Routing key this message was published with
Source
# File lib/bunny/get_response.rb, line 50 def to_hash @hash end
@return [Hash] Hash representation of this delivery info