Method: Gem::Net::HTTP#ipaddr=

Defined in:
lib/rubygems/vendor/net-http/lib/net/http.rb

#ipaddr=(addr) ⇒ Object

Sets the IP address for the connection:

http = Gem::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.

Raises:

  • (IOError)


1363
1364
1365
1366
# File 'lib/rubygems/vendor/net-http/lib/net/http.rb', line 1363

def ipaddr=(addr)
  raise IOError, "ipaddr value changed, but session already started" if started?
  @ipaddr = addr
end