Class: Mercury::Fake::Metadata
- Inherits:
-
Object
- Object
- Mercury::Fake::Metadata
- Defined in:
- lib/mercury/fake/metadata.rb
Instance Attribute Summary collapse
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
Instance Method Summary collapse
- #ack ⇒ Object
-
#initialize(tag, headers, dequeue, requeue) ⇒ Metadata
constructor
A new instance of Metadata.
- #reject(opts) ⇒ Object
- #routing_key ⇒ Object
Constructor Details
#initialize(tag, headers, dequeue, requeue) ⇒ Metadata
Returns a new instance of Metadata.
6 7 8 9 10 11 |
# File 'lib/mercury/fake/metadata.rb', line 6 def initialize(tag, headers, dequeue, requeue) @tag = tag @dequeue = dequeue @requeue = requeue @headers = headers end |
Instance Attribute Details
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
4 5 6 |
# File 'lib/mercury/fake/metadata.rb', line 4 def headers @headers end |
Instance Method Details
#ack ⇒ Object
17 18 19 |
# File 'lib/mercury/fake/metadata.rb', line 17 def ack @dequeue.call end |
#reject(opts) ⇒ Object
21 22 23 24 |
# File 'lib/mercury/fake/metadata.rb', line 21 def reject(opts) requeue = opts[:requeue] requeue ? @requeue.call : @dequeue.call end |
#routing_key ⇒ Object
13 14 15 |
# File 'lib/mercury/fake/metadata.rb', line 13 def routing_key @tag end |