File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -1036,6 +1036,7 @@ def ipaddr=(addr)
10361036 #
10371037 # Argument +retries+ must be a non-negative numeric value:
10381038 #
1039+ # http = Net::HTTP.new(hostname)
10391040 # http.max_retries = 2 # => 2
10401041 # http.max_retries # => 2
10411042 #
@@ -1049,13 +1050,27 @@ def max_retries=(retries)
10491050
10501051 attr_reader :max_retries
10511052
1052- # Setter for the read_timeout attribute.
1053+ # Sets the read timeout, in seconds, for +self+ to integer +sec+;
1054+ # the initial value is 60.
1055+ #
1056+ # Argument +sec+ must be a non-negative numeric value:
1057+ #
1058+ # http = Net::HTTP.new(hostname)
1059+ # http.read_timeout # => 60
1060+ # http.get('/todos/1') # => #<Net::HTTPOK 200 OK readbody=true>
1061+ # http.read_timeout = 0
1062+ # http.get('/todos/1') # Raises Net::ReadTimeout.
1063+ #
10531064 def read_timeout = ( sec )
10541065 @socket . read_timeout = sec if @socket
10551066 @read_timeout = sec
10561067 end
10571068
1058- # Setter for the write_timeout attribute.
1069+ # Sets the write timeout, in seconds, for +self+ to integer +sec+;
1070+ # the initial value is 60.
1071+ #
1072+ # Argument +sec+ must be a non-negative numeric value.
1073+ #
10591074 def write_timeout = ( sec )
10601075 @socket . write_timeout = sec if @socket
10611076 @write_timeout = sec
You can’t perform that action at this time.
0 commit comments