Class: Hyrax::EmbargoPresenter
- Inherits:
-
Object
- Object
- Hyrax::EmbargoPresenter
- Includes:
- ModelProxy
- Defined in:
- app/presenters/hyrax/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
- #enforced? ⇒ Boolean
-
#initialize(solr_document) ⇒ EmbargoPresenter
constructor
A new instance of EmbargoPresenter.
- #visibility_after_embargo ⇒ Object
Methods included from ModelProxy
#persisted?, #to_model, #valid_child_concerns
Constructor Details
#initialize(solr_document) ⇒ EmbargoPresenter
Returns a new instance of EmbargoPresenter.
11 12 13 |
# File 'app/presenters/hyrax/embargo_presenter.rb', line 11 def initialize(solr_document) @solr_document = solr_document end |
Instance Attribute Details
#solr_document ⇒ Object
Returns the value of attribute solr_document.
6 7 8 |
# File 'app/presenters/hyrax/embargo_presenter.rb', line 6 def solr_document @solr_document end |
Instance Method Details
#embargo_history ⇒ Object
23 24 25 |
# File 'app/presenters/hyrax/embargo_presenter.rb', line 23 def solr_document['embargo_history_ssim'] end |
#embargo_release_date ⇒ Object
15 16 17 |
# File 'app/presenters/hyrax/embargo_presenter.rb', line 15 def solr_document..to_formatted_s(:rfc822) end |
#enforced? ⇒ Boolean
27 28 29 |
# File 'app/presenters/hyrax/embargo_presenter.rb', line 27 def enforced? solr_document. end |
#visibility_after_embargo ⇒ Object
19 20 21 |
# File 'app/presenters/hyrax/embargo_presenter.rb', line 19 def solr_document.fetch('visibility_after_embargo_ssim', []).first end |