Parse a raw cookie string into a hash of cookie-name=>Cookie pairs.
cookies = CGI::Cookie.parse("raw_cookie_string") # { "name1" => cookie1, "name2" => cookie2, ... }
Store session data on the server. For some session storage types, this is a no-op.
Returns the IP address for the connection.
If the session has not been started, returns the value set by ipaddr=
, or nil
if it has not been set:
http = Net::HTTP.new(hostname) http.ipaddr # => nil http.ipaddr = '172.67.155.76' http.ipaddr # => "172.67.155.76"
If the session has been started, returns the IP address from the socket:
http = Net::HTTP.new(hostname) http.start http.ipaddr # => "172.67.155.76" http.finish
Sets the IP address for the connection:
http = Net::HTTP.new(hostname) http.ipaddr # => nil http.ipaddr = '172.67.155.76' http.ipaddr # => "172.67.155.76"
The IP address may not be set if the session has been started.
Returns the authority for an HTTP
uri, as defined in www.rfc-editor.org/rfc/rfc3986#section-3.2.
Example:
URI::HTTP.build(host: 'www.example.com', path: '/foo/bar').authority #=> "www.example.com" URI::HTTP.build(host: 'www.example.com', port: 8000, path: '/foo/bar').authority #=> "www.example.com:8000" URI::HTTP.build(host: 'www.example.com', port: 80, path: '/foo/bar').authority #=> "www.example.com"
Completion
for hash key.
Returns the binary operator used to modify the receiver. This method is deprecated in favor of binary_operator.
Returns the binary operator used to modify the receiver. This method is deprecated in favor of binary_operator.
Returns the binary operator used to modify the receiver. This method is deprecated in favor of binary_operator.
Returns the binary operator used to modify the receiver. This method is deprecated in favor of binary_operator.
Returns the binary operator used to modify the receiver. This method is deprecated in favor of binary_operator.
Returns the value of the node as an IntegerNode or a FloatNode. This method is deprecated in favor of value
or numerator/#denominator.
Returns the binary operator used to modify the receiver. This method is deprecated in favor of binary_operator.
Returns the binary operator used to modify the receiver. This method is deprecated in favor of binary_operator.
Returns the binary operator used to modify the receiver. This method is deprecated in favor of binary_operator.
Returns all comments that are associated with this location (both leading and trailing comments).
A Location
object representing the location of this token in the source.