Sha256: 594110069e2eba6daf86853d8e41e3d3347bd45509b749984372209f598f5c2a

Contents?: true

Size: 870 Bytes

Versions: 44

Compression:

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

44 entries across 44 versions & 1 rubygems

Version Path
pact_broker-2.112.0 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.111.0 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.109.1 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.109.0 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.108.0 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.107.1 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.107.0 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.107.0.beta.1 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.106.0 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.105.0 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.104.0 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.103.0 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.102.2 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.102.1 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.102.0 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.101.0 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.100.0 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.99.0 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.98.0 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.97.0 lib/pact_broker/ui/view_models/index_items.rb