From da626e4e42d2b9ac2b902d46a6525adcf5a7602e Mon Sep 17 00:00:00 2001 From: BurdetteLamar Date: Thu, 15 Dec 2022 15:11:06 +0000 Subject: [PATCH] Enhanced RDoc for Net::HTTP --- lib/net/http.rb | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/lib/net/http.rb b/lib/net/http.rb index 2a4e8dc1..e5ef7116 100644 --- a/lib/net/http.rb +++ b/lib/net/http.rb @@ -1036,6 +1036,7 @@ def ipaddr=(addr) # # Argument +retries+ must be a non-negative numeric value: # + # http = Net::HTTP.new(hostname) # http.max_retries = 2 # => 2 # http.max_retries # => 2 # @@ -1049,13 +1050,27 @@ def max_retries=(retries) attr_reader :max_retries - # Setter for the read_timeout attribute. + # Sets the read timeout, in seconds, for +self+ to integer +sec+; + # the initial value is 60. + # + # Argument +sec+ must be a non-negative numeric value: + # + # http = Net::HTTP.new(hostname) + # http.read_timeout # => 60 + # http.get('/todos/1') # => # + # http.read_timeout = 0 + # http.get('/todos/1') # Raises Net::ReadTimeout. + # def read_timeout=(sec) @socket.read_timeout = sec if @socket @read_timeout = sec end - # Setter for the write_timeout attribute. + # Sets the write timeout, in seconds, for +self+ to integer +sec+; + # the initial value is 60. + # + # Argument +sec+ must be a non-negative numeric value. + # def write_timeout=(sec) @socket.write_timeout = sec if @socket @write_timeout = sec