Sha256: 1fc25941c3484123bfd3a21be1eaba8beb4741d6cb04ac4a058d208fe0a71f5a

Contents?: true

Size: 583 Bytes

Versions: 34

Compression:

Stored size: 583 Bytes

Contents

require 'pact_broker/ui/view_models/index_item'

module PactBroker
  module UI
    module ViewDomain
      class IndexItems

        def initialize index_items
          @index_items = index_items.collect{ |index_item| IndexItem.new(index_item) }.sort
        end

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

        def size_label
          case index_items.size
          when 1 then "1 pact"
          else
            "#{index_items.size} pacts"
          end
        end

        private

        attr_reader :index_items
      end
    end
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
pact_broker-2.29.0 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.27.6 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.27.5 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.27.4 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.27.3 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.27.2 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.27.0 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.26.1 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.26.0 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.25.0 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.24.0 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.23.4 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.23.3 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.23.2 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.23.1 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.23.0 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.22.0 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.21.0 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.20.0 lib/pact_broker/ui/view_models/index_items.rb
pact_broker-2.19.2 lib/pact_broker/ui/view_models/index_items.rb