Sha256: 115cd8af81498ebd4dc481720e037d37ae372cc3c7d3fa84ef6b80634e9adfa5

Contents?: true

Size: 846 Bytes

Versions: 18

Compression:

Stored size: 846 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
          # Why are we sorting twice!?
          @index_items = index_items.collect{ |index_item| IndexItem.new(index_item) }.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

18 entries across 18 versions & 1 rubygems

Version Path
pact_broker-2.54.0 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.53.0 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.52.2 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.52.1 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.52.0 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.51.0 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.50.1 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.50.0 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.49.0 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.48.0 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.47.1 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.47.0 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.46.0 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.45.0 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.44.0 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.43.0 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.42.0 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.41.0 lib/pact_broker/ui/view_models/index_items.rb