Class: BunnyMock::GetResponse
- Inherits:
-
Object
- Object
- BunnyMock::GetResponse
- Includes:
- Enumerable
- Defined in:
- lib/bunny_mock/get_response.rb
Instance Attribute Summary collapse
-
#channel ⇒ BunnyMock::Channel
readonly
Channel the response is from.
-
#queue ⇒ BunnyMock::Queue
readonly
Queue the response is from.
Class Method Summary collapse
-
.next_delivery_tag ⇒ Integer
Incrementing numerically value to support
#ack
with multiple=true.
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 ⇒ BunnyMock::Channel (readonly)
Returns Channel the response is from.
15 16 17 |
# File 'lib/bunny_mock/get_response.rb', line 15 def channel @channel end |
#queue ⇒ BunnyMock::Queue (readonly)
Returns Queue the response is from.
18 19 20 |
# File 'lib/bunny_mock/get_response.rb', line 18 def queue @queue end |
Class Method Details
.next_delivery_tag ⇒ Integer
Returns incrementing numerically value to support #ack
with multiple=true.
81 82 83 84 |
# File 'lib/bunny_mock/get_response.rb', line 81 def self.next_delivery_tag @delivery_tag ||= 0 @delivery_tag += 1 end |
Instance Method Details
#[](k) ⇒ Object
Accesses delivery properties by key
40 41 42 |
# File 'lib/bunny_mock/get_response.rb', line 40 def [](k) @hash[k] end |
#delivery_tag ⇒ String
Returns Delivery identifier that is used to acknowledge, reject and nack deliveries.
60 61 62 |
# File 'lib/bunny_mock/get_response.rb', line 60 def delivery_tag @hash[:delivery_tag] end |
#each(*args, &block) ⇒ Object
Iterates over the delivery properties
34 35 36 |
# File 'lib/bunny_mock/get_response.rb', line 34 def each(*args, &block) @hash.each(*args, &block) end |
#exchange ⇒ String
Returns Name of the exchange this message was published to.
71 72 73 |
# File 'lib/bunny_mock/get_response.rb', line 71 def exchange @hash[:exchange] end |
#redelivered ⇒ Boolean Also known as: redelivered?
Returns true if this delivery is a redelivery (the message was requeued at least once).
65 66 67 |
# File 'lib/bunny_mock/get_response.rb', line 65 def redelivered @hash[:redelivered] end |
#routing_key ⇒ String
Returns Routing key this message was published with.
76 77 78 |
# File 'lib/bunny_mock/get_response.rb', line 76 def routing_key @hash[:routing_key] end |
#to_hash ⇒ Hash
Returns Hash representation of this delivery info.
45 46 47 |
# File 'lib/bunny_mock/get_response.rb', line 45 def to_hash @hash end |