Class: Textus::Application::Writes::Publish
- Inherits:
-
Object
- Object
- Textus::Application::Writes::Publish
- Defined in:
- lib/textus/application/writes/publish.rb
Instance Method Summary collapse
- #call(source:, target:, key:) ⇒ Object
-
#initialize(ctx:, bus:) ⇒ Publish
constructor
A new instance of Publish.
Constructor Details
#initialize(ctx:, bus:) ⇒ Publish
Returns a new instance of Publish.
5 6 7 8 |
# File 'lib/textus/application/writes/publish.rb', line 5 def initialize(ctx:, bus:) @ctx = ctx @bus = bus end |
Instance Method Details
#call(source:, target:, key:) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/textus/application/writes/publish.rb', line 10 def call(source:, target:, key:) Textus::Infra::Publisher.publish( source: source, target: target, store_root: @ctx.store.root, ) @bus.publish(:published, key: key, source: source, target: target, correlation_id: @ctx.correlation_id) end |