Class: Hyrax::Actors::InterpretVisibilityActor::Intention
- Inherits:
-
VisibilityIntention
- Object
- VisibilityIntention
- Hyrax::Actors::InterpretVisibilityActor::Intention
- Defined in:
- app/actors/hyrax/actors/interpret_visibility_actor.rb
Constant Summary
Constants inherited from VisibilityIntention
VisibilityIntention::EMBARGO_REQUEST, VisibilityIntention::LEASE_REQUEST, VisibilityIntention::PRIVATE, VisibilityIntention::PUBLIC
Instance Attribute Summary
Attributes inherited from VisibilityIntention
#after, #during, #release_date, #visibility
Instance Method Summary collapse
-
#initialize(attributes) ⇒ Intention
constructor
A new instance of Intention.
-
#sanitize_params ⇒ Object
returns a copy of attributes with the necessary params removed If the lease or embargo is valid, or if they selected something besides lease or embargo, remove all the params.
Methods inherited from VisibilityIntention
#embargo_params, #lease_params, #valid_embargo?, #valid_lease?, #wants_embargo?, #wants_lease?
Constructor Details
#initialize(attributes) ⇒ Intention
Returns a new instance of Intention.
6 7 8 9 10 |
# File 'app/actors/hyrax/actors/interpret_visibility_actor.rb', line 6 def initialize(attributes) @attributes = attributes instance_vars_from_attributes end |
Instance Method Details
#sanitize_params ⇒ Object
returns a copy of attributes with the necessary params removed If the lease or embargo is valid, or if they selected something besides lease or embargo, remove all the params.
15 16 17 18 19 20 21 22 23 24 25 |
# File 'app/actors/hyrax/actors/interpret_visibility_actor.rb', line 15 def sanitize_params if valid_lease? sanitize_lease_params elsif elsif !wants_lease? && ! sanitize_unrestricted_params else @attributes end end |