Class: CurationConcerns::Workflow::NotificationGenerator
- Inherits:
-
Object
- Object
- CurationConcerns::Workflow::NotificationGenerator
- Defined in:
- app/services/curation_concerns/workflow/notification_generator.rb
Overview
Responsible for writing the database records for the given :workflow and :notification_configuration.
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(workflow:, notification_configuration:) ⇒ NotificationGenerator
constructor
A new instance of NotificationGenerator.
Constructor Details
#initialize(workflow:, notification_configuration:) ⇒ NotificationGenerator
Returns a new instance of NotificationGenerator.
16 17 18 19 20 |
# File 'app/services/curation_concerns/workflow/notification_generator.rb', line 16 def initialize(workflow:, notification_configuration:) self.workflow = workflow self.notification_configuration = notification_configuration assign_scope! end |
Class Method Details
.call(workflow:, notification_configuration:) ⇒ Sipity::Notification
10 11 12 |
# File 'app/services/curation_concerns/workflow/notification_generator.rb', line 10 def self.call(workflow:, notification_configuration:) new(workflow: workflow, notification_configuration: notification_configuration).call end |
Instance Method Details
#call ⇒ Object
22 23 24 25 26 27 |
# File 'app/services/curation_concerns/workflow/notification_generator.rb', line 22 def call notification = persist_notification assign_recipients_to(notification: notification) assign_scope_and_reason_to(notification: notification) notification end |