Sha256: dca16711f59ed7f4b26ae79ba77b3556af16307ef8317ac7f7d56f336e5d3f38

Contents?: true

Size: 434 Bytes

Versions: 1

Compression:

Stored size: 434 Bytes

Contents

module Contracts
  class Contract
    def initialize(request, response)
      @request = request
      @response = response
    end

    def instantiate(values = nil)
      instantiated_contract = InstantiatedContract.new(@request, @response.instantiate)
      instantiated_contract.replace!(values) unless values.nil?
      instantiated_contract
    end

    def validate
      @response.validate(@request.execute)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
contracts_api_test-0.0.1 lib/contracts/contract.rb