# File lib/webmock/request_pattern.rb, line 17
17: def matches?(request_signature)
18: content_type = request_signature.headers['Content-Type'] if request_signature.headers
19: @method_pattern.matches?(request_signature.method) &&
20: @uri_pattern.matches?(request_signature.uri) &&
21: (@body_pattern.nil? || @body_pattern.matches?(request_signature.body, content_type || "")) &&
22: (@headers_pattern.nil? || @headers_pattern.matches?(request_signature.headers)) &&
23: (@with_block.nil? || @with_block.call(request_signature))
24: end
# File lib/webmock/request_pattern.rb, line 26
26: def to_s
27: string = "#{@method_pattern.to_s.upcase}"
28: string << " #{@uri_pattern.to_s}"
29: string << " with body #{@body_pattern.to_s}" if @body_pattern
30: string << " with headers #{@headers_pattern.to_s}" if @headers_pattern
31: string << " with given block" if @with_block
32: string
33: end
# File lib/webmock/request_pattern.rb, line 38
38: def assign_options(options)
39: @body_pattern = BodyPattern.new(options[:body]) if options.has_key?(:body)
40: @headers_pattern = HeadersPattern.new(options[:headers]) if options.has_key?(:headers)
41: @uri_pattern.add_query_params(options[:query]) if options.has_key?(:query)
42: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.