Sha256: eb2f97d66a9176e513e59758a68f01dd193ad86d8f3a258b56416fc0b76485af

Contents?: true

Size: 581 Bytes

Versions: 121

Compression:

Stored size: 581 Bytes

Contents

require 'json'
require 'pact_broker/client/pact_hash'

module PactBroker
  module Client
    class PactFile
      def initialize path
        @path = path
      end

      def path
        @path
      end

      def pact_name
        pact_hash.pact_name
      end

      def consumer_name
        pact_hash.consumer_name
      end

      def provider_name
        pact_hash.provider_name
      end

      def pact_hash
        @pact_hash ||= PactHash[JSON.parse(read, symbolize_names: true)]
      end

      def read
        @read ||= File.read(@path)
      end
    end
  end
end

Version data entries

121 entries across 121 versions & 1 rubygems

Version Path
pact_broker-client-1.63.0 lib/pact_broker/client/pact_file.rb
pact_broker-client-1.62.1 lib/pact_broker/client/pact_file.rb
pact_broker-client-1.62.0 lib/pact_broker/client/pact_file.rb
pact_broker-client-1.61.1 lib/pact_broker/client/pact_file.rb
pact_broker-client-1.61.0 lib/pact_broker/client/pact_file.rb
pact_broker-client-1.60.0 lib/pact_broker/client/pact_file.rb
pact_broker-client-1.59.0 lib/pact_broker/client/pact_file.rb
pact_broker-client-1.58.0 lib/pact_broker/client/pact_file.rb
pact_broker-client-1.57.0 lib/pact_broker/client/pact_file.rb
pact_broker-client-1.56.0 lib/pact_broker/client/pact_file.rb
pact_broker-client-1.55.0 lib/pact_broker/client/pact_file.rb
pact_broker-client-1.54.0 lib/pact_broker/client/pact_file.rb
pact_broker-client-1.53.0 lib/pact_broker/client/pact_file.rb
pact_broker-client-1.52.0 lib/pact_broker/client/pact_file.rb
pact_broker-client-1.51.2 lib/pact_broker/client/pact_file.rb
pact_broker-client-1.51.1 lib/pact_broker/client/pact_file.rb
pact_broker-client-1.51.0 lib/pact_broker/client/pact_file.rb
pact_broker-client-1.50.0 lib/pact_broker/client/pact_file.rb
pact_broker-client-1.49.0 lib/pact_broker/client/pact_file.rb
pact_broker-client-1.48.0 lib/pact_broker/client/pact_file.rb