Class: Hyrax::EmbargoPresenter

Inherits:
Object
  • Object
show all
Includes:
ModelProxy
Defined in:
app/presenters/hyrax/embargo_presenter.rb

Overview

Presents embargoed objects

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ModelProxy

#persisted?, #to_model, #to_partial_path

Constructor Details

#initialize(solr_document) ⇒ EmbargoPresenter

Returns a new instance of EmbargoPresenter.

Parameters:



10
11
12
# File 'app/presenters/hyrax/embargo_presenter.rb', line 10

def initialize(solr_document)
  @solr_document = solr_document
end

Instance Attribute Details

#solr_documentObject

Returns the value of attribute solr_document.



5
6
7
# File 'app/presenters/hyrax/embargo_presenter.rb', line 5

def solr_document
  @solr_document
end

Instance Method Details

#embargo_historyObject



22
23
24
# File 'app/presenters/hyrax/embargo_presenter.rb', line 22

def embargo_history
  solr_document['embargo_history_ssim']
end

#embargo_release_dateObject



14
15
16
# File 'app/presenters/hyrax/embargo_presenter.rb', line 14

def embargo_release_date
  solr_document.embargo_release_date.to_formatted_s(:rfc822)
end

#visibility_after_embargoObject



18
19
20
# File 'app/presenters/hyrax/embargo_presenter.rb', line 18

def visibility_after_embargo
  solr_document.fetch('visibility_after_embargo_ssim', []).first
end