Sha256: 858a4585535d13656d758362aebd42d6b41e1708a6233c9bcdc90d6eaa11174a

Contents?: true

Size: 707 Bytes

Versions: 48

Compression:

Stored size: 707 Bytes

Contents

module Hyrax
  # Presents leased objects
  class LeasePresenter
    include ModelProxy
    attr_accessor :solr_document

    delegate :human_readable_type, :visibility, :to_s, to: :solr_document

    # @param [SolrDocument] solr_document
    def initialize(solr_document)
      @solr_document = solr_document
    end

    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

    def visibility_after_lease
      solr_document.fetch('visibility_after_lease_ssim', []).first
    end

    def lease_history
      solr_document['lease_history_ssim']
    end
  end
end

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
hyrax-2.9.6 app/presenters/hyrax/lease_presenter.rb
hyrax-2.9.5 app/presenters/hyrax/lease_presenter.rb
hyrax-2.9.4 app/presenters/hyrax/lease_presenter.rb
hyrax-2.9.3 app/presenters/hyrax/lease_presenter.rb
hyrax-2.9.2 app/presenters/hyrax/lease_presenter.rb
hyrax-2.9.1 app/presenters/hyrax/lease_presenter.rb
hyrax-2.9.0 app/presenters/hyrax/lease_presenter.rb
hyrax-2.8.0 app/presenters/hyrax/lease_presenter.rb
hyrax-2.7.2 app/presenters/hyrax/lease_presenter.rb
hyrax-2.7.1 app/presenters/hyrax/lease_presenter.rb
hyrax-2.7.0 app/presenters/hyrax/lease_presenter.rb
hyrax-2.6.0 app/presenters/hyrax/lease_presenter.rb
hyrax-3.0.0.pre.rc1 app/presenters/hyrax/lease_presenter.rb
hyrax-3.0.0.pre.beta3 app/presenters/hyrax/lease_presenter.rb
hyrax-2.5.1 app/presenters/hyrax/lease_presenter.rb
hyrax-2.5.0 app/presenters/hyrax/lease_presenter.rb
hyrax-3.0.0.pre.beta2 app/presenters/hyrax/lease_presenter.rb
hyrax-2.4.1 app/presenters/hyrax/lease_presenter.rb
hyrax-3.0.0.pre.beta1 app/presenters/hyrax/lease_presenter.rb
hyrax-2.4.0 app/presenters/hyrax/lease_presenter.rb