class HTTParty::Response::Headers

Public Class Methods

new(header_values = nil) click to toggle source
Calls superclass method
# File lib/httparty/response/headers.rb, line 10
def initialize(header_values = nil)
  @header = {}
  if header_values
    header_values.each_pair do |k,v|
      if v.is_a?(Array)
        v.each do |sub_v|
          add_field(k, sub_v)
        end
      else
        add_field(k, v)
      end
    end
  end
  super(@header)
end

Public Instance Methods

==(other) click to toggle source
# File lib/httparty/response/headers.rb, line 26
def ==(other)
  if other.is_a?(::Net::HTTPHeader)
    @header == other.instance_variable_get(:@header)
  elsif other.is_a?(Hash)
    @header == other || @header == Headers.new(other).instance_variable_get(:@header)
  end
end