Class: CurationConcerns::Actors::BaseActor
- Inherits:
-
AbstractActor
- Object
- AbstractActor
- CurationConcerns::Actors::BaseActor
- Defined in:
- app/actors/curation_concerns/actors/base_actor.rb
Overview
The CurationConcern base actor responds to two primary actions:
-
#create
-
#update
it must instantiate the next actor in the chain and instantiate it. it should respond to curation_concern, user and attributes.
Instance Attribute Summary collapse
- #cloud_resources ⇒ Object readonly
Attributes inherited from AbstractActor
Instance Method Summary collapse
Methods inherited from AbstractActor
Constructor Details
This class inherits a constructor from CurationConcerns::Actors::AbstractActor
Instance Attribute Details
#cloud_resources ⇒ Object (readonly)
9 10 11 |
# File 'app/actors/curation_concerns/actors/base_actor.rb', line 9 def cloud_resources @cloud_resources end |
Instance Method Details
#create(attributes) ⇒ Object
11 12 13 14 15 16 |
# File 'app/actors/curation_concerns/actors/base_actor.rb', line 11 def create(attributes) @cloud_resources = attributes.delete(:cloud_resources.to_s) apply_creation_data_to_curation_concern apply_save_data_to_curation_concern(attributes) save && next_actor.create(attributes) && run_callbacks(:after_create_concern) end |
#update(attributes) ⇒ Object
18 19 20 21 22 |
# File 'app/actors/curation_concerns/actors/base_actor.rb', line 18 def update(attributes) apply_update_data_to_curation_concern apply_save_data_to_curation_concern(attributes) next_actor.update(attributes) && save && run_callbacks(:after_update_metadata) end |