Class: IPSocket

Inherits:
Object
  • Object
show all
Defined in:
lib/net/dns/resolv-replace.rb

Class Method Summary collapse

Class Method Details

.getaddress(host) ⇒ Object



9
10
11
12
13
14
15
16
# File 'lib/net/dns/resolv-replace.rb', line 9

def getaddress(host)
  return original_resolv_getaddress(host) if Fixnum === host
  begin
    return Resolv.getaddress(host).to_s
  rescue Resolv::ResolvError
    raise SocketError, "Hostname not known: #{host}"
  end
end

.original_resolv_getaddressObject



8
# File 'lib/net/dns/resolv-replace.rb', line 8

alias original_resolv_getaddress getaddress