Class: Hyrax::Workflow::WorkflowFactory
- Inherits:
-
Object
- Object
- Hyrax::Workflow::WorkflowFactory
- Defined in:
- app/services/hyrax/workflow/workflow_factory.rb
Overview
Responsible for:
-
Creating a Sipity::Entity (aka a database proxy for the given work)
-
Assigning specific roles to the Sipity::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.
30 31 32 33 34 |
# File 'app/services/hyrax/workflow/workflow_factory.rb', line 30 def initialize(work, attributes, user) @work = work @attributes = attributes @user = user end |
Class Method Details
.create(work, attributes, user) ⇒ TrueClass
23 24 25 |
# File 'app/services/hyrax/workflow/workflow_factory.rb', line 23 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
42 43 44 45 46 47 48 |
# File 'app/services/hyrax/workflow/workflow_factory.rb', line 42 def create action = find_deposit_action entity = create_workflow_entity! assign_specific_roles_to(entity: entity) run_workflow_action!(action: action) true end |