Class: Bunny::DeliveryInfo
- Inherits:
-
Object
- Object
- Bunny::DeliveryInfo
- Includes:
- Enumerable
- Defined in:
- lib/bunny/delivery_info.rb
Overview
Wraps AMQ::Protocol::Basic::Deliver to provide access to the delivery properties as immutable hash as well as methods.
Instance Attribute Summary collapse
-
#channel ⇒ Bunny::Channel
readonly
Channel this delivery is on.
-
#consumer ⇒ Bunny::Consumer
readonly
Consumer this delivery is for.
Instance Method Summary collapse
-
#[](k) ⇒ Object
Accesses delivery properties by key.
-
#consumer_tag ⇒ String
Consumer tag this delivery is for.
-
#delivery_tag ⇒ String
Delivery identifier that is used to acknowledge, reject and nack deliveries.
-
#each(*args, &block) ⇒ Object
Iterates over 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 delivery is on.
22 23 24 |
# File 'lib/bunny/delivery_info.rb', line 22 def channel @channel end |
#consumer ⇒ Bunny::Consumer (readonly)
Returns Consumer this delivery is for.
20 21 22 |
# File 'lib/bunny/delivery_info.rb', line 20 def consumer @consumer end |
Instance Method Details
#[](k) ⇒ Object
Accesses delivery properties by key
48 49 50 |
# File 'lib/bunny/delivery_info.rb', line 48 def [](k) @hash[k] end |
#consumer_tag ⇒ String
Returns Consumer tag this delivery is for.
68 69 70 |
# File 'lib/bunny/delivery_info.rb', line 68 def consumer_tag @basic_deliver.consumer_tag end |
#delivery_tag ⇒ String
Returns Delivery identifier that is used to acknowledge, reject and nack deliveries.
73 74 75 |
# File 'lib/bunny/delivery_info.rb', line 73 def delivery_tag @basic_deliver.delivery_tag end |
#each(*args, &block) ⇒ Object
Iterates over delivery properties
42 43 44 |
# File 'lib/bunny/delivery_info.rb', line 42 def each(*args, &block) @hash.each(*args, &block) end |
#exchange ⇒ String
Returns Name of the exchange this message was published to.
84 85 86 |
# File 'lib/bunny/delivery_info.rb', line 84 def exchange @basic_deliver.exchange end |
#redelivered ⇒ Boolean Also known as: redelivered?
Returns true if this delivery is a redelivery (the message was requeued at least once).
78 79 80 |
# File 'lib/bunny/delivery_info.rb', line 78 def redelivered @basic_deliver.redelivered end |
#routing_key ⇒ String
Returns Routing key this message was published with.
89 90 91 |
# File 'lib/bunny/delivery_info.rb', line 89 def routing_key @basic_deliver.routing_key end |
#to_hash ⇒ Hash
Returns Hash representation of this delivery info.
53 54 55 |
# File 'lib/bunny/delivery_info.rb', line 53 def to_hash @hash end |