# File lib/webmock/request_signature.rb, line 8 def initialize(method, uri, options = {}) self.method = method self.uri = uri.is_a?(Addressable::URI) ? uri : WebMock::Util::URI.normalize_uri(uri) assign_options(options) end
# File lib/webmock/request_signature.rb, line 32 def eql?(other) self.to_s == other.to_s end
# File lib/webmock/request_signature.rb, line 28 def hash self.to_s.hash end
# File lib/webmock/request_signature.rb, line 24 def headers=(headers) @headers = WebMock::Util::Headers.normalize_headers(headers) end
# File lib/webmock/request_signature.rb, line 14 def to_s string = "#{self.method.to_s.upcase}" string << " #{WebMock::Util::URI.strip_default_port_from_uri_string(self.uri.to_s)}" string << " with body '#{body.to_s}'" if body && body.to_s != '' if headers && !headers.empty? string << " with headers #{WebMock::Util::Headers.sorted_headers_string(headers)}" end string end
# File lib/webmock/request_signature.rb, line 36 def url_encoded? headers && headers['Content-Type'] == 'application/x-www-form-urlencoded' end