Class: Hyrax::Workflow::WorkflowFactory
- Inherits:
-
Object
- Object
- Hyrax::Workflow::WorkflowFactory
- Defined in:
- app/services/hyrax/workflow/workflow_factory.rb
Overview
Responsible for:
-
Creating a workflow entity
-
Assigning specific roles to the entity (but not the workflow)
-
Running the deposit_action
Class Method Summary collapse
Instance Method Summary collapse
-
#create ⇒ TrueClass
Creates a Sipity::Entity for the work.
-
#initialize(work, attributes, user) ⇒ WorkflowFactory
constructor
A new instance of WorkflowFactory.
Constructor Details
#initialize(work, attributes, user) ⇒ WorkflowFactory
Returns a new instance of WorkflowFactory.
28 29 30 31 32 |
# File 'app/services/hyrax/workflow/workflow_factory.rb', line 28 def initialize(work, attributes, user) @work = work @attributes = attributes @user = user end |
Class Method Details
.create(work, attributes, user) ⇒ TrueClass
21 22 23 |
# File 'app/services/hyrax/workflow/workflow_factory.rb', line 21 def self.create(work, attributes, user) new(work, attributes, user).create end |
Instance Method Details
#create ⇒ TrueClass
Creates a Sipity::Entity for the work. The Sipity::Entity acts as a proxy to a work within a workflow
40 41 42 43 44 45 |
# File 'app/services/hyrax/workflow/workflow_factory.rb', line 40 def create entity = create_workflow_entity! assign_specific_roles_to(entity: entity) run_workflow_action! true end |