Take a location from the prism parser and set the necessary instance variables.
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') # => #<Net::HTTPOK 200 OK readbody=true> http.read_timeout = 0 http.get('/todos/1') # Raises Net::ReadTimeout.
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:
_uri = uri.dup _uri.path = '/posts' body = 'bar' * 200000 data = <<EOF {"title": "foo", "body": "#{body}", "userId": "1"} EOF headers = {'content-type': 'application/json'} http = Net::HTTP.new(hostname) http.write_timeout # => 60 http.post(_uri.path, data, headers) # => #<Net::HTTPCreated 201 Created readbody=true> http.write_timeout = 0 http.post(_uri.path, data, headers) # Raises Net::WriteTimeout.
Sets the continue timeout value, which is the number of seconds to wait for an expected 100 Continue response. If the HTTP object does not receive a response in this many seconds it sends the request body.
Returns the password of the proxy server, if defined, nil
otherwise; see Proxy Server.
Sets the body stream for the request:
req = Net::HTTP::Post.new(uri) # => #<Net::HTTP::Post POST> req.body_stream # => nil require 'stringio' req.body_stream = StringIO.new('xyzzy') # => #<StringIO:0x0000027d1e5affa8> req.body_stream # => #<StringIO:0x0000027d1e5affa8>
Returns the location of the binary operator used to modify the receiver. This method is deprecated in favor of binary_operator_loc.
Returns the location of the binary operator used to modify the receiver. This method is deprecated in favor of binary_operator_loc.
Returns the location of the binary operator used to modify the receiver. This method is deprecated in favor of binary_operator_loc.
Returns the location of the binary operator used to modify the receiver. This method is deprecated in favor of binary_operator_loc.
Returns the location of the binary operator used to modify the receiver. This method is deprecated in favor of binary_operator_loc.
Occasionally it’s helpful to treat a string as if it were interpolated so that there’s a consistent interface for working with strings.
Occasionally it’s helpful to treat a string as if it were interpolated so that there’s a consistent interface for working with strings.
Returns the location of the binary operator used to modify the receiver. This method is deprecated in favor of binary_operator_loc.
Returns the location of the binary operator used to modify the receiver. This method is deprecated in favor of binary_operator_loc.
Returns the location of the binary operator used to modify the receiver. This method is deprecated in favor of binary_operator_loc.
These are the comments that are associated with this location that exist before the start of this location.
Attach a comment to the leading comments of this location.
These are the comments that are associated with this location that exist after the end of this location.
Attach a comment to the trailing comments of this location.