Sha256: 88ae8a94c977420ad281865d8ab6a28d12708a4dbff51b5e092b1f7ee6558c6a

Contents?: true

Size: 379 Bytes

Versions: 5

Compression:

Stored size: 379 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

5 entries across 5 versions & 1 rubygems

Version Path
sufia-6.2.0 app/presenters/sufia/version_list_presenter.rb
sufia-6.1.0 app/presenters/sufia/version_list_presenter.rb
sufia-6.0.0 app/presenters/sufia/version_list_presenter.rb
sufia-6.0.0.rc4 app/presenters/sufia/version_list_presenter.rb
sufia-6.0.0.rc3 app/presenters/sufia/version_list_presenter.rb