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.20.0 lib/pact_broker/client/pact_file.rb
pact_broker-client-1.19.0 lib/pact_broker/client/pact_file.rb
pact_broker-client-1.18.0 lib/pact_broker/client/pact_file.rb
pact_broker-client-1.17.0 lib/pact_broker/client/pact_file.rb
pact_broker-client-1.16.2 lib/pact_broker/client/pact_file.rb
pact_broker-client-1.16.1 lib/pact_broker/client/pact_file.rb
pact_broker-client-1.16.0 lib/pact_broker/client/pact_file.rb
pact_broker-client-1.15.1 lib/pact_broker/client/pact_file.rb
pact_broker-client-1.15.0 lib/pact_broker/client/pact_file.rb
pact_broker-client-1.14.1 lib/pact_broker/client/pact_file.rb
pact_broker-client-1.14.0 lib/pact_broker/client/pact_file.rb
pact_broker-client-1.13.1 lib/pact_broker/client/pact_file.rb
pact_broker-client-1.13.0 lib/pact_broker/client/pact_file.rb
pact_broker-client-1.12.0 lib/pact_broker/client/pact_file.rb
pact_broker-client-1.11.0 lib/pact_broker/client/pact_file.rb
pact_broker-client-1.10.0 lib/pact_broker/client/pact_file.rb
pact_broker-client-1.9.0 lib/pact_broker/client/pact_file.rb
pact_broker-client-1.8.0 lib/pact_broker/client/pact_file.rb
pact_broker-client-1.7.0 lib/pact_broker/client/pact_file.rb
pact_broker-client-1.6.0 lib/pact_broker/client/pact_file.rb