class WebMock::URIAddressablePattern
Public Instance Methods
Source
# File lib/webmock/request_pattern.rb, line 178 def add_query_params(query_params) @@add_query_params_warned ||= false if not @@add_query_params_warned @@add_query_params_warned = true warn "WebMock warning: ignoring query params in RFC 6570 template and checking them with WebMock" end super(query_params) end
Calls superclass method
WebMock::URIPattern#add_query_params
Private Instance Methods
Source
# File lib/webmock/request_pattern.rb, line 203 def matches_with_variations?(uri) template = begin Addressable::Template.new(WebMock::Util::URI.heuristic_parse(@pattern.pattern)) rescue Addressable::URI::InvalidURIError Addressable::Template.new(@pattern.pattern) end WebMock::Util::URI.variations_of_uri_as_strings(uri).any? { |u| template_matches_uri?(template, u) } end
Source
# File lib/webmock/request_pattern.rb, line 199 def pattern_inspect @pattern.pattern.inspect end
Source
# File lib/webmock/request_pattern.rb, line 189 def pattern_matches?(uri) if @query_params.nil? # Let Addressable check the whole URI matches_with_variations?(uri) else # WebMock checks the query, Addressable checks everything else matches_with_variations?(uri.omit(:query)) end end
Source
# File lib/webmock/request_pattern.rb, line 215 def template_matches_uri?(template, uri) template.match(uri) rescue Addressable::URI::InvalidURIError false end