Sha256: 854d0b8bc5319fc145960d2f7e5d96e0fb6d440b17d0141705b2a2832e895854

Contents?: true

Size: 869 Bytes

Versions: 37

Compression:

Stored size: 869 Bytes

Contents

require 'pact_broker/ui/view_models/index_item'

module PactBroker
  module UI
    module ViewDomain
      class IndexItems

        attr_reader :pagination_record_count

        def initialize index_items, options = {}
          # Why are we sorting twice!?
          @index_items = index_items.collect{ |index_item| IndexItem.new(index_item, options) }.sort
          # until the feature flag is turned on
          @pagination_record_count = index_items.size
          @pagination_record_count = index_items.pagination_record_count if index_items.respond_to?(:pagination_record_count)
        end

        def each(&block)
          index_items.each(&block)
        end

        def empty?
          index_items.empty?
        end

        def size
          index_items.size
        end

        private

        attr_reader :index_items
      end
    end
  end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
pact_broker-2.79.1 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.79.0 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.78.1 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.78.0 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.77.0 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.76.2 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.76.1 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.76.0 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.75.0 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.74.1 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.74.0 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.73.0 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.72.0 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.71.0 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.70.0 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.69.0 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.68.1 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.68.0 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.67.0 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.66.0 lib/pact_broker/ui/view_models/index_items.rb