Sha256: fa1d61f689b2d315e9ccd2fd74594cb8cd945db8b1b183baa755714da31e04dc

Contents?: true

Size: 578 Bytes

Versions: 44

Compression:

Stored size: 578 Bytes

Contents

module Pact
  class ProviderState

    attr_reader :name, :params

    def initialize name, params = {}
      @name = name
      @params = params
    end

    def self.from_hash(hash)
      new(hash["name"], hash["params"])
    end

    def ==(other)
      other.is_a?(Pact::ProviderState) && other.name == self.name && other.params == self.params
    end

    def to_hash
      {
        "name" => name,
        "params" => params
      }
    end

    def to_json(opts = {})
      as_json(opts).to_json(opts)
    end

    def as_json(opts = {})
      to_hash
    end
  end
end

Version data entries

44 entries across 44 versions & 2 rubygems

Version Path
pact-support-1.21.1 lib/pact/consumer_contract/provider_state.rb
pact-support-1.21.0 lib/pact/consumer_contract/provider_state.rb
pact-support-1.20.2 lib/pact/consumer_contract/provider_state.rb
pact-support-1.20.1 lib/pact/consumer_contract/provider_state.rb
pact-support-1.20.0 lib/pact/consumer_contract/provider_state.rb
pact-support-1.19.0 lib/pact/consumer_contract/provider_state.rb
pact-support-1.18.1 lib/pact/consumer_contract/provider_state.rb
pact-support-1.18.0 lib/pact/consumer_contract/provider_state.rb
hs-pact-support-1.17.1 lib/pact/consumer_contract/provider_state.rb
pact-support-1.17.0 lib/pact/consumer_contract/provider_state.rb
pact-support-1.16.10 lib/pact/consumer_contract/provider_state.rb
pact-support-1.16.9 lib/pact/consumer_contract/provider_state.rb
pact-support-1.16.8 lib/pact/consumer_contract/provider_state.rb
pact-support-1.16.7 lib/pact/consumer_contract/provider_state.rb
pact-support-1.16.6 lib/pact/consumer_contract/provider_state.rb
pact-support-1.16.5 lib/pact/consumer_contract/provider_state.rb
pact-support-1.16.4 lib/pact/consumer_contract/provider_state.rb
pact-support-1.16.3 lib/pact/consumer_contract/provider_state.rb
pact-support-1.16.2 lib/pact/consumer_contract/provider_state.rb
pact-support-1.17.0.pre.rc2 lib/pact/consumer_contract/provider_state.rb