Class: Dor::Event::Client::CreateOperation
- Inherits:
-
Object
- Object
- Dor::Event::Client::CreateOperation
- Defined in:
- lib/dor/event/client/create_operation.rb
Overview
Create an Event
Instance Method Summary collapse
-
#create(druid:, type:, data:) ⇒ Boolean
True if successful.
-
#initialize(channel:) ⇒ CreateOperation
constructor
A new instance of CreateOperation.
Constructor Details
#initialize(channel:) ⇒ CreateOperation
Returns a new instance of CreateOperation.
8 9 10 |
# File 'lib/dor/event/client/create_operation.rb', line 8 def initialize(channel:) @channel = channel end |
Instance Method Details
#create(druid:, type:, data:) ⇒ Boolean
Returns true if successful.
16 17 18 19 20 21 |
# File 'lib/dor/event/client/create_operation.rb', line 16 def create(druid:, type:, data:) = { druid: druid, event_type: type, data: data } channel.topic('sdr.objects.event').publish(.to_json, routing_key: type) true end |