I'm using Ruby 1.9.3-p448 and looking at the Standard Library API
reference which comes as CHM file and I see the following:
Class Net::HTTPResponse ... It mixes in the HTTPHeader module, which
provides access to response header values both via hash-like methods and
via individual readers. ...
Then I'm starting irb session and doing this:
require 'net/http'
h=Net::HTTP.start 'example.com'
r=h.get '/'
p r.get_fields 'set-cookie'
The last line fails with an error: "NoMethodError: undefined method
`get_field' for..."
Why is that? The r is an object of the class Net::HTTPOK, which has
the following ancestors: [Net::HTTPOK, Net::HTTPSuccess,
Net::HTTPResponse, Net::HTTPHeader, Object, Kernel, BasicObject]
Net::HTTPHeader.methods.grep /field/ yields nothing. Does it turn out
that the documentation is incorrect? I'm puzzled.
Subject: Documentation says Net::HTTPResponse mixes in HTTPHeader, but I can't access its methods
Date: mer 04 set 13 06:59:16 +0200
--
* Se la Strada e la sua Virtu' non fossero state messe da parte,
* K * Carlo E. Prelz - fluido@fluido.as che bisogno ci sarebbe
* di parlare tanto di amore e di rettitudine? (Chuang-Tzu)