class WebMock::URIPattern
Public Class Methods
new(pattern)
click to toggle source
# File lib/webmock/request_pattern.rb, line 85 def initialize(pattern) @pattern = pattern.is_a?(Addressable::URI) ? pattern : WebMock::Util::URI.normalize_uri(pattern) @query_params = nil end
Public Instance Methods
add_query_params(query_params)
click to toggle source
# File lib/webmock/request_pattern.rb, line 90 def add_query_params(query_params) @query_params = if query_params.is_a?(Hash) query_params elsif query_params.is_a?(WebMock::Matchers::HashIncludingMatcher) query_params elsif rSpecHashIncludingMatcher?(query_params) WebMock::Matchers::HashIncludingMatcher.from_rspec_matcher(query_params) else WebMock::Util::QueryMapper.query_to_values(query_params) end end
to_s()
click to toggle source
# File lib/webmock/request_pattern.rb, line 102 def to_s str = @pattern.inspect str += " with query params #{@query_params.inspect}" if @query_params str end