Class: WebMock::URIStringPattern

Inherits:
URIPattern show all
Defined in:
lib/webmock/request_pattern.rb

Instance Method Summary collapse

Methods inherited from URIPattern

#initialize, #matches?, #to_s

Methods included from RSpecMatcherDetector

#rSpecHashExcludingMatcher?, #rSpecHashIncludingMatcher?

Constructor Details

This class inherits a constructor from WebMock::URIPattern

Instance Method Details

#add_query_params(query_params) ⇒ Object



221
222
223
224
225
226
227
228
# File 'lib/webmock/request_pattern.rb', line 221

def add_query_params(query_params)
  super
  if @query_params.is_a?(Hash) || @query_params.is_a?(String)
    query_hash = (WebMock::Util::QueryMapper.query_to_values(@pattern.query, notation: Config.instance.query_values_notation) || {}).merge(@query_params)
    @pattern.query = WebMock::Util::QueryMapper.values_to_query(query_hash, notation: WebMock::Config.instance.query_values_notation)
    @query_params = nil
  end
end