Class: Hyrax::Actors::InterpretVisibilityActor
- Inherits:
-
AbstractActor
- Object
- AbstractActor
- Hyrax::Actors::InterpretVisibilityActor
- Defined in:
- app/actors/hyrax/actors/interpret_visibility_actor.rb
Defined Under Namespace
Classes: Intention
Instance Attribute Summary
Attributes inherited from AbstractActor
Instance Method Summary collapse
-
#create(env) ⇒ Boolean
True if create was successful.
-
#update(env) ⇒ Boolean
True if update was successful.
Methods inherited from AbstractActor
Constructor Details
This class inherits a constructor from Hyrax::Actors::AbstractActor
Instance Method Details
#create(env) ⇒ Boolean
Returns true if create was successful.
84 85 86 87 88 89 90 |
# File 'app/actors/hyrax/actors/interpret_visibility_actor.rb', line 84 def create(env) intention = Intention.new(env.attributes) attributes = intention.sanitize_params new_env = Environment.new(env.curation_concern, env.current_ability, attributes) validate(env, intention, attributes) && apply_visibility(new_env, intention) && next_actor.create(new_env) end |
#update(env) ⇒ Boolean
Returns true if update was successful.
94 95 96 97 98 99 100 |
# File 'app/actors/hyrax/actors/interpret_visibility_actor.rb', line 94 def update(env) intention = Intention.new(env.attributes) attributes = intention.sanitize_params new_env = Environment.new(env.curation_concern, env.current_ability, attributes) validate(env, intention, attributes) && apply_visibility(new_env, intention) && next_actor.update(new_env) end |