Sha256: 462abb6a59996f26261e8fdfc3b93a8344c7a7c2bacbc57a594980d8da144a53

Contents?: true

Size: 609 Bytes

Versions: 57

Compression:

Stored size: 609 Bytes

Contents

require 'pact_broker/ui/view_models/relationship'

module PactBroker
  module UI
    module ViewDomain
      class Relationships

        def initialize relationships
          @relationships = relationships.collect{ |relationship| Relationship.new(relationship) }.sort
        end

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

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

        private

        attr_reader :relationships
      end
    end
  end
end

Version data entries

57 entries across 57 versions & 1 rubygems

Version Path
pact_broker-2.9.0 lib/pact_broker/ui/view_models/relationships.rb
pact_broker-2.9.0.beta.5 lib/pact_broker/ui/view_models/relationships.rb
pact_broker-2.8.0.beta.5 lib/pact_broker/ui/view_models/relationships.rb
pact_broker-2.8.0.beta.4 lib/pact_broker/ui/view_models/relationships.rb
pact_broker-2.7.0.beta.3 lib/pact_broker/ui/view_models/relationships.rb
pact_broker-2.7.0.beta.2 lib/pact_broker/ui/view_models/relationships.rb
pact_broker-2.7.0.beta.1 lib/pact_broker/ui/view_models/relationships.rb
pact_broker-2.6.0 lib/pact_broker/ui/view_models/relationships.rb
pact_broker-2.5.1 lib/pact_broker/ui/view_models/relationships.rb
pact_broker-2.5.0 lib/pact_broker/ui/view_models/relationships.rb
pact_broker-2.4.2 lib/pact_broker/ui/view_models/relationships.rb
pact_broker-2.4.1 lib/pact_broker/ui/view_models/relationships.rb
pact_broker-2.4.0 lib/pact_broker/ui/view_models/relationships.rb
pact_broker-2.3.0 lib/pact_broker/ui/view_models/relationships.rb
pact_broker-2.2.0 lib/pact_broker/ui/view_models/relationships.rb
pact_broker-2.1.1 lib/pact_broker/ui/view_models/relationships.rb
pact_broker-2.1.0 lib/pact_broker/ui/view_models/relationships.rb
pact_broker-2.0.5 lib/pact_broker/ui/view_models/relationships.rb
pact_broker-2.0.4 lib/pact_broker/ui/view_models/relationships.rb
pact_broker-2.0.3 lib/pact_broker/ui/view_models/relationships.rb