Sha256: 85666016b46ebb26e4ee30acc5ad2f1836228993aa7bc8ae314ac9a36015d1c3

Contents?: true

Size: 653 Bytes

Versions: 21

Compression:

Stored size: 653 Bytes

Contents

# frozen_string_literal: true
module Hyrax
  # Presents embargoed objects
  class EmbargoPresenter
    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 embargo_release_date
      solr_document.embargo_release_date.to_formatted_s(:rfc822)
    end

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

    def embargo_history
      solr_document['embargo_history_ssim']
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

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