Sha256: 4c8b83b5c92b800f1e45281e7e47d2deac623fce19ab37b7f7c392dc8d38c02b

Contents?: true

Size: 737 Bytes

Versions: 22

Compression:

Stored size: 737 Bytes

Contents

# frozen_string_literal: true
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

22 entries across 22 versions & 1 rubygems

Version Path
hyrax-5.0.0.rc2 app/presenters/hyrax/lease_presenter.rb
hyrax-5.0.0.rc1 app/presenters/hyrax/lease_presenter.rb
hyrax-3.6.0 app/presenters/hyrax/lease_presenter.rb
hyrax-4.0.0 app/presenters/hyrax/lease_presenter.rb
hyrax-4.0.0.rc3 app/presenters/hyrax/lease_presenter.rb
hyrax-4.0.0.rc2 app/presenters/hyrax/lease_presenter.rb
hyrax-4.0.0.rc1 app/presenters/hyrax/lease_presenter.rb
hyrax-3.5.0 app/presenters/hyrax/lease_presenter.rb
hyrax-4.0.0.beta2 app/presenters/hyrax/lease_presenter.rb
hyrax-3.4.2 app/presenters/hyrax/lease_presenter.rb
hyrax-4.0.0.beta1 app/presenters/hyrax/lease_presenter.rb
hyrax-3.4.1 app/presenters/hyrax/lease_presenter.rb
hyrax-3.4.0 app/presenters/hyrax/lease_presenter.rb
hyrax-3.3.0 app/presenters/hyrax/lease_presenter.rb
hyrax-3.2.0 app/presenters/hyrax/lease_presenter.rb
hyrax-3.1.0 app/presenters/hyrax/lease_presenter.rb
hyrax-3.0.2 app/presenters/hyrax/lease_presenter.rb
hyrax-3.0.1 app/presenters/hyrax/lease_presenter.rb
hyrax-3.0.0 app/presenters/hyrax/lease_presenter.rb
hyrax-3.0.0.pre.rc4 app/presenters/hyrax/lease_presenter.rb