Sha256: 91236b0750b1d0a5772e5c2fd156c8c11a3e8a325f256e425bb94ae889d15b89

Contents?: true

Size: 889 Bytes

Versions: 45

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

45 entries across 45 versions & 1 rubygems

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