Class: Bunny::GetResponse
- Inherits:
-
Object
- Object
- Bunny::GetResponse
- Includes:
- Enumerable
- Defined in:
- lib/bunny/get_response.rb
Overview
Wraps AMQ::Protocol::Basic::GetOk to provide access to the delivery properties as immutable hash as well as methods.
Instance Attribute Summary collapse
-
#channel ⇒ Bunny::Channel
readonly
Channel this basic.get-ok response is on.
Instance Method Summary collapse
-
#[](k) ⇒ Object
Accesses delivery properties by key.
-
#delivery_tag ⇒ String
Delivery identifier that is used to acknowledge, reject and nack deliveries.
-
#each(*args, &block) ⇒ Object
Iterates over the delivery properties.
-
#exchange ⇒ String
Name of the exchange this message was published to.
-
#redelivered ⇒ Boolean
(also: #redelivered?)
True if this delivery is a redelivery (the message was requeued at least once).
-
#routing_key ⇒ String
Routing key this message was published with.
-
#to_hash ⇒ Hash
Hash representation of this delivery info.
Instance Attribute Details
#channel ⇒ Bunny::Channel (readonly)
Returns Channel this basic.get-ok response is on
20 21 22 |
# File 'lib/bunny/get_response.rb', line 20 def channel @channel end |
Instance Method Details
#[](k) ⇒ Object
Accesses delivery properties by key
43 44 45 |
# File 'lib/bunny/get_response.rb', line 43 def [](k) @hash[k] end |
#delivery_tag ⇒ String
Returns Delivery identifier that is used to acknowledge, reject and nack deliveries
63 64 65 |
# File 'lib/bunny/get_response.rb', line 63 def delivery_tag @get_ok.delivery_tag end |
#each(*args, &block) ⇒ Object
Iterates over the delivery properties
37 38 39 |
# File 'lib/bunny/get_response.rb', line 37 def each(*args, &block) @hash.each(*args, &block) end |
#exchange ⇒ String
Returns Name of the exchange this message was published to
74 75 76 |
# File 'lib/bunny/get_response.rb', line 74 def exchange @get_ok.exchange end |
#redelivered ⇒ Boolean Also known as: redelivered?
Returns true if this delivery is a redelivery (the message was requeued at least once)
68 69 70 |
# File 'lib/bunny/get_response.rb', line 68 def redelivered @get_ok.redelivered end |
#routing_key ⇒ String
Returns Routing key this message was published with
79 80 81 |
# File 'lib/bunny/get_response.rb', line 79 def routing_key @get_ok.routing_key end |
#to_hash ⇒ Hash
Returns Hash representation of this delivery info
48 49 50 |
# File 'lib/bunny/get_response.rb', line 48 def to_hash @hash end |