Class: Hyrax::Workflow::NotificationGenerator
- Inherits:
-
Object
- Object
- Hyrax::Workflow::NotificationGenerator
- Defined in:
- app/services/hyrax/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.
17 18 19 20 21 |
# File 'app/services/hyrax/workflow/notification_generator.rb', line 17 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
11 12 13 |
# File 'app/services/hyrax/workflow/notification_generator.rb', line 11 def self.call(workflow:, notification_configuration:) new(workflow: workflow, notification_configuration: notification_configuration).call end |
Instance Method Details
#call ⇒ Object
23 24 25 26 27 28 |
# File 'app/services/hyrax/workflow/notification_generator.rb', line 23 def call notification = persist_notification assign_recipients_to(notification: notification) assign_scope_and_reason_to(notification: notification) notification end |