Class: CurationConcerns::EmbargoPresenter
- Inherits:
-
Object
- Object
- CurationConcerns::EmbargoPresenter
- Includes:
- ModelProxy
- Defined in:
- app/presenters/curation_concerns/embargo_presenter.rb
Overview
Presents embargoed objects
Instance Attribute Summary collapse
-
#solr_document ⇒ Object
Returns the value of attribute solr_document.
Instance Method Summary collapse
- #embargo_history ⇒ Object
- #embargo_release_date ⇒ Object
-
#initialize(solr_document) ⇒ EmbargoPresenter
constructor
A new instance of EmbargoPresenter.
- #visibility_after_embargo ⇒ Object
Methods included from ModelProxy
#persisted?, #to_model, #to_partial_path
Constructor Details
#initialize(solr_document) ⇒ EmbargoPresenter
Returns a new instance of EmbargoPresenter.
10 11 12 |
# File 'app/presenters/curation_concerns/embargo_presenter.rb', line 10 def initialize(solr_document) @solr_document = solr_document end |
Instance Attribute Details
#solr_document ⇒ Object
Returns the value of attribute solr_document.
5 6 7 |
# File 'app/presenters/curation_concerns/embargo_presenter.rb', line 5 def solr_document @solr_document end |
Instance Method Details
#embargo_history ⇒ Object
22 23 24 |
# File 'app/presenters/curation_concerns/embargo_presenter.rb', line 22 def solr_document['embargo_history_ssim'] end |
#embargo_release_date ⇒ Object
14 15 16 |
# File 'app/presenters/curation_concerns/embargo_presenter.rb', line 14 def Date.parse(solr_document.).to_formatted_s(:rfc822) end |
#visibility_after_embargo ⇒ Object
18 19 20 |
# File 'app/presenters/curation_concerns/embargo_presenter.rb', line 18 def solr_document.fetch('visibility_after_embargo_ssim', []).first end |