Sha256: 6be7aaf249d6716970967418953650d58d146c9693c235a09c62dec02a69d7ac

Contents?: true

Size: 646 Bytes

Versions: 66

Compression:

Stored size: 646 Bytes

Contents

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

66 entries across 66 versions & 1 rubygems

Version Path
curation_concerns-1.3.2 app/presenters/curation_concerns/embargo_presenter.rb
curation_concerns-1.3.1 app/presenters/curation_concerns/embargo_presenter.rb
curation_concerns-1.3.0 app/presenters/curation_concerns/embargo_presenter.rb
curation_concerns-1.2.0 app/presenters/curation_concerns/embargo_presenter.rb
curation_concerns-1.1.2 app/presenters/curation_concerns/embargo_presenter.rb
curation_concerns-1.1.1 app/presenters/curation_concerns/embargo_presenter.rb
curation_concerns-1.1.0 app/presenters/curation_concerns/embargo_presenter.rb
curation_concerns-1.0.0 app/presenters/curation_concerns/embargo_presenter.rb
curation_concerns-1.0.0.beta10 app/presenters/curation_concerns/embargo_presenter.rb
curation_concerns-1.0.0.beta9 app/presenters/curation_concerns/embargo_presenter.rb
curation_concerns-1.0.0.beta8 app/presenters/curation_concerns/embargo_presenter.rb
curation_concerns-1.0.0.beta7 app/presenters/curation_concerns/embargo_presenter.rb
curation_concerns-1.0.0.beta6 app/presenters/curation_concerns/embargo_presenter.rb
curation_concerns-1.0.0.beta5 app/presenters/curation_concerns/embargo_presenter.rb
curation_concerns-1.0.0.beta4 app/presenters/curation_concerns/embargo_presenter.rb
curation_concerns-1.0.0.beta3 app/presenters/curation_concerns/embargo_presenter.rb
curation_concerns-1.0.0.beta2 app/presenters/curation_concerns/embargo_presenter.rb
curation_concerns-1.0.0.beta1 app/presenters/curation_concerns/embargo_presenter.rb
curation_concerns-0.14.0 app/presenters/curation_concerns/embargo_presenter.rb
curation_concerns-0.14.0.pre4 app/presenters/curation_concerns/embargo_presenter.rb