Class: Hyrax::Actors::InterpretVisibilityActor

Inherits:
AbstractActor show all
Defined in:
app/actors/hyrax/actors/interpret_visibility_actor.rb

Defined Under Namespace

Classes: Intention

Instance Attribute Summary

Attributes inherited from AbstractActor

#next_actor

Instance Method Summary collapse

Methods inherited from AbstractActor

#initialize

Constructor Details

This class inherits a constructor from Hyrax::Actors::AbstractActor

Instance Method Details

#create(env) ⇒ Boolean

Returns true if create was successful.

Parameters:

Returns:

  • (Boolean)

    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.

Parameters:

Returns:

  • (Boolean)

    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