Class: CurationConcerns::Actors::EmbargoActor

Inherits:
Object
  • Object
show all
Defined in:
app/actors/curation_concerns/actors/embargo_actor.rb

Overview

Since:

  • 0.14.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(work) ⇒ EmbargoActor

Returns a new instance of EmbargoActor.

Parameters:

  • work (Hydra::Works::Work)

Since:

  • 0.14.0



7
8
9
# File 'app/actors/curation_concerns/actors/embargo_actor.rb', line 7

def initialize(work)
  @work = work
end

Instance Attribute Details

#workObject (readonly)

Since:

  • 0.14.0



4
5
6
# File 'app/actors/curation_concerns/actors/embargo_actor.rb', line 4

def work
  @work
end

Instance Method Details

#destroyObject

Update the visibility of the work to match the correct state of the embargo, then clear the embargo date, etc. Saves the embargo and the work

Since:

  • 0.14.0



13
14
15
16
17
18
# File 'app/actors/curation_concerns/actors/embargo_actor.rb', line 13

def destroy
  work.embargo_visibility! # If the embargo has lapsed, update the current visibility.
  work.deactivate_embargo!
  work.embargo.save!
  work.save!
end