Sha256: 480f9662023105628f91aaf0e5dc862521ee760e989525d8de70a48bfd7b39b1

Contents?: true

Size: 786 Bytes

Versions: 3

Compression:

Stored size: 786 Bytes

Contents

module CurationConcerns
  module Actors
    class ActorFactory
      def self.build(curation_concern, current_user)
        Actors::ActorStack.new(curation_concern,
                               current_user,
                               stack_actors(curation_concern))
      end

      def self.stack_actors(curation_concern)
        [AddToCollectionActor,
         AssignRepresentativeActor,
         AttachFilesActor,
         ApplyOrderActor,
         InterpretVisibilityActor,
         model_actor(curation_concern),
         AssignIdentifierActor]
      end

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
curation_concerns-1.0.0.beta4 app/services/curation_concerns/actors/actor_factory.rb
curation_concerns-1.0.0.beta3 app/services/curation_concerns/actors/actor_factory.rb
curation_concerns-1.0.0.beta2 app/services/curation_concerns/actors/actor_factory.rb