Class: CurationConcerns::Actors::BaseActor

Inherits:
AbstractActor show all
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.

Since:

  • 0.14.0

Instance Attribute Summary collapse

Attributes inherited from AbstractActor

#next_actor

Instance Method Summary collapse

Methods inherited from AbstractActor

#initialize

Constructor Details

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

Instance Attribute Details

#cloud_resourcesObject (readonly)

Since:

  • 0.14.0



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

Since:

  • 0.14.0



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

Since:

  • 0.14.0



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