Sha256: 9c1f29d70b9b6c3db7538c38460376ff7ec066bd51d047ef12053b73e6224bce

Contents?: true

Size: 730 Bytes

Versions: 66

Compression:

Stored size: 730 Bytes

Contents

module CurationConcerns
  # 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
        Date.parse(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

66 entries across 66 versions & 1 rubygems

Version Path
curation_concerns-1.7.8 app/presenters/curation_concerns/lease_presenter.rb
curation_concerns-1.7.7 app/presenters/curation_concerns/lease_presenter.rb
curation_concerns-2.0.0 app/presenters/curation_concerns/lease_presenter.rb
curation_concerns-2.0.0.rc2 app/presenters/curation_concerns/lease_presenter.rb
curation_concerns-1.7.6 app/presenters/curation_concerns/lease_presenter.rb
curation_concerns-1.7.5 app/presenters/curation_concerns/lease_presenter.rb
curation_concerns-1.7.4 app/presenters/curation_concerns/lease_presenter.rb
curation_concerns-1.7.3 app/presenters/curation_concerns/lease_presenter.rb
curation_concerns-1.7.2 app/presenters/curation_concerns/lease_presenter.rb
curation_concerns-2.0.0.rc1 app/presenters/curation_concerns/lease_presenter.rb
curation_concerns-1.7.1 app/presenters/curation_concerns/lease_presenter.rb
curation_concerns-1.7.0 app/presenters/curation_concerns/lease_presenter.rb
curation_concerns-1.7.0.beta1 app/presenters/curation_concerns/lease_presenter.rb
curation_concerns-1.6.3 app/presenters/curation_concerns/lease_presenter.rb
curation_concerns-1.6.2 app/presenters/curation_concerns/lease_presenter.rb
curation_concerns-1.6.1 app/presenters/curation_concerns/lease_presenter.rb
curation_concerns-1.6.0 app/presenters/curation_concerns/lease_presenter.rb
curation_concerns-1.5.0 app/presenters/curation_concerns/lease_presenter.rb
curation_concerns-1.4.0 app/presenters/curation_concerns/lease_presenter.rb
curation_concerns-1.3.3 app/presenters/curation_concerns/lease_presenter.rb