Parent

Faraday::Adapter::Test::Stub

Public Class Methods

new(full, body, block) click to toggle source
# File lib/faraday/adapter/test.rb, line 106
def initialize(full, body, block)
  path, query = full.split('?')
  params = query ?
    Faraday::Utils.parse_nested_query(query) :
    {}
  super path, params, body, block
end

Public Instance Methods

matches?(request_uri, request_body) click to toggle source
# File lib/faraday/adapter/test.rb, line 114
def matches?(request_uri, request_body)
  request_path, request_query = request_uri.split('?')
  request_params = request_query ?
    Faraday::Utils.parse_nested_query(request_query) :
    {}
  request_path == path &&
    params_match?(request_params) &&
    (body.to_s.size.zero? || request_body == body)
end
params_match?(request_params) click to toggle source
# File lib/faraday/adapter/test.rb, line 124
def params_match?(request_params)
  params.keys.all? do |key|
    request_params[key] == params[key]
  end
end
to_s() click to toggle source
# File lib/faraday/adapter/test.rb, line 130
def to_s
  "#{path} #{body}"
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.