Class: Fare::TestMode::QueueAdapter
- Inherits:
-
Object
- Object
- Fare::TestMode::QueueAdapter
- Defined in:
- lib/fare/test_mode.rb
Defined Under Namespace
Classes: FakeQueue
Instance Method Summary collapse
- #clear ⇒ Object
- #fetch(environment, queue_name) ⇒ Object
- #fetch_by_arn(arn) ⇒ Object
-
#initialize ⇒ QueueAdapter
constructor
A new instance of QueueAdapter.
- #queues ⇒ Object
Constructor Details
#initialize ⇒ QueueAdapter
Returns a new instance of QueueAdapter.
97 98 99 |
# File 'lib/fare/test_mode.rb', line 97 def initialize @queues = {} end |
Instance Method Details
#clear ⇒ Object
113 114 115 |
# File 'lib/fare/test_mode.rb', line 113 def clear queues.each(&:clear) end |
#fetch(environment, queue_name) ⇒ Object
101 102 103 |
# File 'lib/fare/test_mode.rb', line 101 def fetch(environment, queue_name) @queues[queue_name] ||= FakeQueue.new(queue_name) end |
#fetch_by_arn(arn) ⇒ Object
105 106 107 |
# File 'lib/fare/test_mode.rb', line 105 def fetch_by_arn(arn) @queues.fetch(arn) end |
#queues ⇒ Object
109 110 111 |
# File 'lib/fare/test_mode.rb', line 109 def queues @queues.values end |