Sha256: 7985a510dcc3f63679fc84a69e568599a5e277f7f598de9f00bba1c80c77d919

Contents?: true

Size: 560 Bytes

Versions: 6

Compression:

Stored size: 560 Bytes

Contents

# frozen_string_literal: true
module Hyrax
  class VersionPresenter
    attr_reader :version, :current

    def initialize(version)
      @version = version
      @current = false
    end

    delegate :label, :uri, to: :version
    alias current? current

    def current!
      @current = true
    end

    def created
      @created ||= version.created.in_time_zone.to_formatted_s(:long_ordinal)
    end

    def committer
      vc = Hyrax::VersionCommitter.where(version_id: @version.uri)
      vc.empty? ? nil : vc.first.committer_login
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
hyrax-3.0.2 app/presenters/hyrax/version_presenter.rb
hyrax-3.0.1 app/presenters/hyrax/version_presenter.rb
hyrax-3.0.0 app/presenters/hyrax/version_presenter.rb
hyrax-3.0.0.pre.rc4 app/presenters/hyrax/version_presenter.rb
hyrax-3.0.0.pre.rc3 app/presenters/hyrax/version_presenter.rb
hyrax-3.0.0.pre.rc2 app/presenters/hyrax/version_presenter.rb