Class: SXS::Publishers::Memory
- Inherits:
-
Object
- Object
- SXS::Publishers::Memory
- Extended by:
- Forwardable
- Defined in:
- lib/sxs/publishers/memory.rb
Instance Attribute Summary collapse
-
#queue_url ⇒ Object
readonly
Returns the value of attribute queue_url.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(queue_url) ⇒ Memory
constructor
A new instance of Memory.
- #messages ⇒ Object
- #publish(body) ⇒ Object
Constructor Details
#initialize(queue_url) ⇒ Memory
12 13 14 |
# File 'lib/sxs/publishers/memory.rb', line 12 def initialize(queue_url) @queue_url = queue_url end |
Instance Attribute Details
#queue_url ⇒ Object (readonly)
Returns the value of attribute queue_url.
8 9 10 |
# File 'lib/sxs/publishers/memory.rb', line 8 def queue_url @queue_url end |
Class Method Details
.clear ⇒ Object
25 26 27 |
# File 'lib/sxs/publishers/memory.rb', line 25 def self.clear @queues = {} end |
.queues ⇒ Object
29 30 31 |
# File 'lib/sxs/publishers/memory.rb', line 29 def self.queues @queues ||= {} end |
Instance Method Details
#messages ⇒ Object
16 17 18 |
# File 'lib/sxs/publishers/memory.rb', line 16 def self.class.queues[@queue_url] end |
#publish(body) ⇒ Object
20 21 22 23 |
# File 'lib/sxs/publishers/memory.rb', line 20 def publish(body) self.class.queues[@queue_url] ||= [] self.class.queues[@queue_url] << body end |