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



74
75
76
77
78
79
# File 'app/actors/hyrax/actors/interpret_visibility_actor.rb', line 74

def create(env)
  intention = Intention.new(env.attributes)
  env.attributes = intention.sanitize_params
  validate(env, intention, env.attributes) && apply_visibility(env, intention) &&
    next_actor.create(env)
end

#update(env) ⇒ Boolean

Returns true if update was successful.

Parameters:

Returns:

  • (Boolean)

    true if update was successful



83
84
85
86
87
88
# File 'app/actors/hyrax/actors/interpret_visibility_actor.rb', line 83

def update(env)
  intention = Intention.new(env.attributes)
  env.attributes = intention.sanitize_params
  validate(env, intention, env.attributes) && apply_visibility(env, intention) &&
    next_actor.update(env)
end