Module: IPSocket (Ruby 2.7.3)
Description: Module : IPSocket - Ruby 2.7.3

### Home Classes Methods

### In Files

- ipaddr.rb

### Methods

- ::getaddress
- ::getaddress_orig

### Class/Module Index

Quicksearch

- IPAddr
- IPAddr::AddressFamilyError
- IPAddr::Error
- IPAddr::InvalidAddressError
- IPAddr::InvalidPrefixError
- IPSocket
- Socket

No matching classes.

# IPSocket

### Public Class Methods

getaddress(s) click to toggle source

Returns a `String` based representation of a valid DNS hostname, IPv4 or IPv6 address.

    IPSocket.getaddress 'localhost'         #=> "::1"
    IPSocket.getaddress 'broadcasthost'     #=> "255.255.255.255"
    IPSocket.getaddress 'www.ruby-lang.org' #=> "221.186.184.68"
    IPSocket.getaddress 'www.ccc.de'        #=> "2a00:1328:e102:ccc0::122"

                   # File ipaddr.rb, line 742
    def getaddress(s)
      if valid_v6?(s)
        s
      else
        getaddress_orig(s)
      end
    end

Also aliased as: getaddress_orig
getaddress_orig(s) click to toggle source
Alias for: getaddress