Class: Hyrax::Workflow::SipityActionsGenerator

Inherits:
Object
  • Object
show all
Defined in:
app/services/hyrax/workflow/sipity_actions_generator.rb

Overview

Responsible for creating database entries for the given workflow's actions

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(workflow:, actions_configuration:) ⇒ SipityActionsGenerator

Returns a new instance of SipityActionsGenerator.


18
19
20
21
# File 'app/services/hyrax/workflow/sipity_actions_generator.rb', line 18

def initialize(workflow:, actions_configuration:)
  self.workflow = workflow
  self.actions_configuration = actions_configuration
end

Class Method Details

.call(workflow:, actions_configuration:, &block) ⇒ Sipity::Workflow

Responsible for creating database entries for the given workflow's actions

Parameters:

  • workflow (Sipity::Workflow)
  • actions_configuration (Hash)

    as defined in Hyrax::Workflow::WorkflowSchema

Returns:

Raises:


14
15
16
# File 'app/services/hyrax/workflow/sipity_actions_generator.rb', line 14

def self.call(workflow:, actions_configuration:, &block)
  new(workflow: workflow, actions_configuration: actions_configuration, &block).call
end

Instance Method Details

#callSipity::Workflow

Returns:

Raises:


37
38
39
40
# File 'app/services/hyrax/workflow/sipity_actions_generator.rb', line 37

def call
  generate_state_diagram!
  workflow
end