Class: CurationConcern::BaseActor
- Inherits:
-
Object
- Object
- CurationConcern::BaseActor
- Defined in:
- app/services/curation_concern/base_actor.rb
Overview
The CurationConcern base actor should respond to three primary actions:
-
#create
-
#update
-
#delete
Direct Known Subclasses
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#curation_concern ⇒ Object
readonly
Returns the value of attribute curation_concern.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
Instance Method Summary collapse
- #create! ⇒ Object
-
#initialize(curation_concern, user, input_attributes) ⇒ BaseActor
constructor
A new instance of BaseActor.
- #update! ⇒ Object
Constructor Details
#initialize(curation_concern, user, input_attributes) ⇒ BaseActor
Returns a new instance of BaseActor.
8 9 10 11 12 13 |
# File 'app/services/curation_concern/base_actor.rb', line 8 def initialize(curation_concern, user, input_attributes) @curation_concern = curation_concern @user = user @attributes = input_attributes.dup @visibility = attributes[:visibility] end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
7 8 9 |
# File 'app/services/curation_concern/base_actor.rb', line 7 def attributes @attributes end |
#curation_concern ⇒ Object (readonly)
Returns the value of attribute curation_concern.
7 8 9 |
# File 'app/services/curation_concern/base_actor.rb', line 7 def curation_concern @curation_concern end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
7 8 9 |
# File 'app/services/curation_concern/base_actor.rb', line 7 def user @user end |
Instance Method Details
#create! ⇒ Object
15 16 17 18 19 20 |
# File 'app/services/curation_concern/base_actor.rb', line 15 def create! curation_concern.(user.user_key) curation_concern.creator = user.name curation_concern.date_uploaded = Date.today save end |
#update! ⇒ Object
22 23 24 |
# File 'app/services/curation_concern/base_actor.rb', line 22 def update! save end |