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, #valid_child_concerns

Constructor Details

#initialize(solr_document) ⇒ EmbargoPresenter

Returns a new instance of EmbargoPresenter.

Parameters:



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_documentObject

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_historyObject



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

def embargo_history
  solr_document['embargo_history_ssim']
end

#embargo_release_dateObject



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

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

#enforced?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'app/presenters/hyrax/embargo_presenter.rb', line 27

def enforced?
  solr_document.embargo_enforced?
end

#visibility_after_embargoObject



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

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