[前][次][番号順一覧][スレッド一覧]

ruby-changes:58456

From: zverok <ko1@a...>
Date: Sun, 27 Oct 2019 02:31:28 +0900 (JST)
Subject: [ruby-changes:58456] 6221248294 (master): Improve Net::HTTP docs:

https://git.ruby-lang.org/ruby.git/commit/?id=6221248294

From 62212482947066d2cbf4dad6ebe60facf35ef223 Mon Sep 17 00:00:00 2001
From: zverok <zverok.offline@g...>
Date: Sat, 26 Oct 2019 12:21:33 +0300
Subject: Improve Net::HTTP docs:

* Make links from Net::GenericHTTPRequest work;
* Document +dest+ param of HTTPResponse#read_body;
* Slightly improve reference to particular response
  classes from HTTPResponse class docs.

diff --git a/lib/net/http/generic_request.rb b/lib/net/http/generic_request.rb
index 3ff6d88..003f59d 100644
--- a/lib/net/http/generic_request.rb
+++ b/lib/net/http/generic_request.rb
@@ -1,8 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/lib/net/http/generic_request.rb#L1
 # frozen_string_literal: false
-# HTTPGenericRequest is the parent of the HTTPRequest class.
-# Do not use this directly; use a subclass of HTTPRequest.
+# HTTPGenericRequest is the parent of the Net::HTTPRequest class.
+# Do not use this directly; use a subclass of Net::HTTPRequest.
 #
-# Mixes in the HTTPHeader module to provide easier access to HTTP headers.
+# Mixes in the Net::HTTPHeader module to provide easier access to HTTP headers.
 #
 class Net::HTTPGenericRequest
 
diff --git a/lib/net/http/response.rb b/lib/net/http/response.rb
index 6613298..8dd5944 100644
--- a/lib/net/http/response.rb
+++ b/lib/net/http/response.rb
@@ -8,11 +8,13 @@ https://github.com/ruby/ruby/blob/trunk/lib/net/http/response.rb#L8
 # header values both via hash-like methods and via individual readers.
 #
 # Note that each possible HTTP response code defines its own
-# HTTPResponse subclass.  These are listed below.
+# HTTPResponse subclass. All classes are defined under the Net module.
+# Indentation indicates inheritance.  For a list of the classes see Net::HTTP.
 #
-# All classes are defined under the Net module. Indentation indicates
-# inheritance.  For a list of the classes see Net::HTTP.
+# Correspondense <code>HTTP code => class</code> is stored in CODE_TO_OBJ
+# constant:
 #
+#    Net::HTTPResponse::CODE_TO_OBJ['404'] #=> Net::HTTPNotFound
 #
 class Net::HTTPResponse
   class << self
@@ -174,6 +176,10 @@ class Net::HTTPResponse https://github.com/ruby/ruby/blob/trunk/lib/net/http/response.rb#L176
   # If a block is given, the body is passed to the block, and
   # the body is provided in fragments, as it is read in from the socket.
   #
+  # If +dest+ argument is given, response is read into that variable,
+  # with <code>dest#<<</code> method (it could be String or IO, or any
+  # other object responding to <code><<</code>).
+  #
   # Calling this method a second or subsequent time for the same
   # HTTPResponse object will return the value already read.
   #
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]