class WebMock::HeadersPattern

def empty_headers?(headers)

def empty_headers?(headers)
  headers.nil? || headers == {}
end

def initialize(pattern)

def initialize(pattern)
  @pattern = WebMock::Util::Headers.normalize_headers(pattern) || {}
end

def matches?(headers)

def matches?(headers)
  if empty_headers?(@pattern)
    empty_headers?(headers)
  else
    return false if empty_headers?(headers)
    @pattern.each do |key, value|
      return false unless headers.has_key?(key) && value === headers[key]
    end
    true
  end
end

def pp_to_s

def pp_to_s
  WebMock::Util::Headers.pp_headers_string(@pattern)
end

def to_s

def to_s
  WebMock::Util::Headers.sorted_headers_string(@pattern)
end