Sha256: 3a13cd7eed6f0704d2d4ed9b0a1b41402a0bd412ec3fad5f00e58ab8ff3a95cb

Contents?: true

Size: 380 Bytes

Versions: 6

Compression:

Stored size: 380 Bytes

Contents

module Sufia
  class VersionListPresenter
    def initialize(version_list)
      @raw_list = version_list
    end

    delegate :each, to: :wrapped_list

    private

      def wrapped_list
        @wrapped_list ||= @raw_list.map { |v| Sufia::VersionPresenter.new(v) }.sort { |a, b| b.version.created <=> a.version.created }.tap { |l| l.first.try(:current!) }
      end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
sufia-6.7.0 app/presenters/sufia/version_list_presenter.rb
sufia-6.6.1 app/presenters/sufia/version_list_presenter.rb
sufia-6.6.0 app/presenters/sufia/version_list_presenter.rb
sufia-6.5.0 app/presenters/sufia/version_list_presenter.rb
sufia-6.4.0 app/presenters/sufia/version_list_presenter.rb
sufia-6.3.0 app/presenters/sufia/version_list_presenter.rb