Sha256: 2180fb0ccebeea3fa939cedb7bc4c9f225b91d225fabfde47341e048a4f3c07f

Contents?: true

Size: 554 Bytes

Versions: 4

Compression:

Stored size: 554 Bytes

Contents

module CurationConcerns
  class VersionPresenter
    attr_reader :version, :current

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

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

    def current!
      @current = true
    end

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

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
curation_concerns-0.5.0 app/presenters/curation_concerns/version_presenter.rb
curation_concerns-0.4.0 app/presenters/curation_concerns/version_presenter.rb
curation_concerns-0.3.0 app/presenters/curation_concerns/version_presenter.rb
curation_concerns-0.2.0 app/presenters/curation_concerns/version_presenter.rb