Sha256: e8681b0581d9721e3f6087e4da88e8ef1d523fc9d8abe588d57a1f4fcc30eac7

Contents?: true

Size: 889 Bytes

Versions: 57

Compression:

Stored size: 889 Bytes

Contents

require 'delegate'

# A head pact is the pact for the latest consumer version with the specified tag
# (ignoring later versions that might have the specified tag but no pact)

module PactBroker
  module Pacts
    class HeadPact < SimpleDelegator
      attr_reader :tag, :consumer_version_number

      def initialize(pact, consumer_version_number, tag)
        super(pact)
        @consumer_version_number = consumer_version_number
        @tag = tag
      end

      # The underlying pact publication may well be the overall latest as well, but
      # this row does not know that, as there will be a row with a nil tag
      # if it is the overall latest as well as a row with the
      # tag set, as the data is denormalised in the LatestTaggedPactPublications table.
      def overall_latest?
        tag.nil?
      end

      def pact
        __getobj__()
      end
    end
  end
end

Version data entries

57 entries across 57 versions & 1 rubygems

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