Project

General

Profile

Bug #446 ยป net_httpheader_fetch_doc.patch

NoKarma (Arthur Schreiber), 08/15/2008 09:47 PM

View differences:

lib/net/http.rb (Arbeitskopie)
end
# Returns the header field corresponding to the case-insensitive key.
# Returns the default value +args+, or the result of the block, or nil,
# if there's no header field named key. See Hash#fetch
# Returns the default value +args+, or the result of the block, or
# raises an IndexErrror if there's no header field named +key+
# See Hash#fetch
def fetch(key, *args, &block) #:yield: +key+
a = @header.fetch(key.downcase, *args, &block)
a.join(', ')
    (1-1/1)