class Resolv::Hosts
Resolv::Hosts is a hostname resolver that uses the system hosts file.
Public Class Methods
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/resolv/0/resolv.rbs, line 1410
def initialize: (?String filename) -> untyped
Creates a new Resolv::Hosts, using filename for its data source.
Public Instance Methods
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/resolv/0/resolv.rbs, line 1358
def each_address: (String name) { (String) -> void } -> void
Iterates over all IP addresses for name retrieved from the hosts file.
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/resolv/0/resolv.rbs, line 1366
def each_name: (String address) { (String) -> void } -> void
Iterates over all hostnames for address retrieved from the hosts file.
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/resolv/0/resolv.rbs, line 1374
def getaddress: (String name) -> String
Gets the IP address of name from the hosts file.
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/resolv/0/resolv.rbs, line 1382
def getaddresses: (String name) -> Array[String]
Gets all IP addresses for name from the hosts file.
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/resolv/0/resolv.rbs, line 1390
def getname: (String address) -> String
Gets the hostname of address from the hosts file.
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/resolv/0/resolv.rbs, line 1398
def getnames: (String address) -> Array[String]
Gets all hostnames for address from the hosts file.
() → void
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/resolv/0/resolv.rbs, line 1400
def lazy_initialize: () -> void