Class: Hermes::Publisher::InMemoryAdapter
- Inherits:
-
Object
- Object
- Hermes::Publisher::InMemoryAdapter
- Defined in:
- lib/hermes/publisher/in_memory_adapter.rb
Instance Attribute Summary collapse
-
#store ⇒ Object
readonly
Returns the value of attribute store.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ InMemoryAdapter
constructor
A new instance of InMemoryAdapter.
- #publish(routing_key, payload, properties = {}, options = {}) ⇒ Object
Constructor Details
#initialize ⇒ InMemoryAdapter
Returns a new instance of InMemoryAdapter.
8 9 10 |
# File 'lib/hermes/publisher/in_memory_adapter.rb', line 8 def initialize @store = [] end |
Instance Attribute Details
#store ⇒ Object (readonly)
Returns the value of attribute store.
3 4 5 |
# File 'lib/hermes/publisher/in_memory_adapter.rb', line 3 def store @store end |
Class Method Details
.connect ⇒ Object
5 6 |
# File 'lib/hermes/publisher/in_memory_adapter.rb', line 5 def self.connect end |
Instance Method Details
#publish(routing_key, payload, properties = {}, options = {}) ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/hermes/publisher/in_memory_adapter.rb', line 12 def publish(routing_key, payload, properties = {}, = {}) = { routing_key: routing_key, payload: payload } [:properties] = properties if properties.any? [:options] = if .any? @store << end |