Class: CurationConcerns::Actors::ActorFactory

Inherits:
Object
  • Object
show all
Defined in:
app/services/curation_concerns/actors/actor_factory.rb

Overview

Since:

  • 0.14.0

Class Method Summary collapse

Class Method Details

.build(curation_concern, current_user) ⇒ Object

Since:

  • 0.14.0



4
5
6
7
8
# File 'app/services/curation_concerns/actors/actor_factory.rb', line 4

def self.build(curation_concern, current_user)
  Actors::ActorStack.new(curation_concern,
                         current_user,
                         stack_actors(curation_concern))
end

.model_actor(curation_concern) ⇒ Object

Since:

  • 0.14.0



22
23
24
25
# File 'app/services/curation_concerns/actors/actor_factory.rb', line 22

def self.model_actor(curation_concern)
  actor_identifier = curation_concern.class.to_s.split('::').last
  "CurationConcerns::Actors::#{actor_identifier}Actor".constantize
end

.stack_actors(curation_concern) ⇒ Object

Since:

  • 0.14.0



10
11
12
13
14
15
16
17
18
19
20
# File 'app/services/curation_concerns/actors/actor_factory.rb', line 10

def self.stack_actors(curation_concern)
  [OptimisticLockValidator,
   AddAsMemberOfCollectionsActor,
   AddToWorkActor,
   AssignRepresentativeActor,
   AttachFilesActor,
   ApplyOrderActor,
   InterpretVisibilityActor,
   model_actor(curation_concern),
   InitializeWorkflowActor]
end