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.



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

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:



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

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

Instance Method Details

#callSipity::Workflow

Returns:

Raises:



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

def call
  generate_state_diagram!
  workflow
end