Method: Mechanize::Parser#fill_header

Defined in:
lib/mechanize/parser.rb

#fill_header(response) ⇒ Object

Creates a Mechanize::Header from the Net::HTTPResponse response.

This allows the Net::HTTPResponse to be garbage collected sooner.



156
157
158
159
160
161
162
163
164
# File 'lib/mechanize/parser.rb', line 156

def fill_header response
  @response = Mechanize::Headers.new

  response.each { |k,v|
    @response[k] = v
  } if response

  @response
end