Class: Hyrax::LeasePresenter
- Inherits:
-
Object
- Object
- Hyrax::LeasePresenter
- Includes:
- ModelProxy
- Defined in:
- app/presenters/hyrax/lease_presenter.rb
Overview
Presents leased objects
Instance Attribute Summary collapse
-
#solr_document ⇒ Object
Returns the value of attribute solr_document.
Instance Method Summary collapse
-
#initialize(solr_document) ⇒ LeasePresenter
constructor
A new instance of LeasePresenter.
- #lease_expiration_date ⇒ Object
- #lease_history ⇒ Object
- #visibility_after_lease ⇒ Object
Methods included from ModelProxy
#persisted?, #to_model, #to_partial_path
Constructor Details
#initialize(solr_document) ⇒ LeasePresenter
Returns a new instance of LeasePresenter.
10 11 12 |
# File 'app/presenters/hyrax/lease_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/hyrax/lease_presenter.rb', line 5 def solr_document @solr_document end |
Instance Method Details
#lease_expiration_date ⇒ Object
14 15 16 17 18 19 20 |
# File 'app/presenters/hyrax/lease_presenter.rb', line 14 def lease_expiration_date if solr_document.lease_expiration_date solr_document.lease_expiration_date.to_formatted_s(:rfc822) else solr_document.keys end end |
#lease_history ⇒ Object
26 27 28 |
# File 'app/presenters/hyrax/lease_presenter.rb', line 26 def lease_history solr_document['lease_history_ssim'] end |
#visibility_after_lease ⇒ Object
22 23 24 |
# File 'app/presenters/hyrax/lease_presenter.rb', line 22 def visibility_after_lease solr_document.fetch('visibility_after_lease_ssim', []).first end |