Class | Resolv
In: | resolv.rb
Parent: | Object

### Methods

each_address each_address each_name each_name getaddress getaddress getaddresses getaddresses getname getname getnames getnames new

### Classes and Modules

Class Resolv::DNS
Class Resolv::Hosts
Class Resolv::IPv4
Class Resolv::IPv6
Class Resolv::ResolvError
Class Resolv::ResolvTimeout

### Constants

DefaultResolver | = | self.new
AddressRegex | = | /(?:#{IPv4::Regex})|(?:#{IPv6::Regex})/

### Public Class methods

each_address(name, &block)

[Source]

    # File resolv.rb, line 206
      def self.each_address(name, &block)
        DefaultResolver.each_address(name, &block)
      end

each_name(address, &proc)

[Source]

    # File resolv.rb, line 218
      def self.each_name(address, &proc)
        DefaultResolver.each_name(address, &proc)
      end

getaddress(name)

[Source]

    # File resolv.rb, line 198
      def self.getaddress(name)
        DefaultResolver.getaddress(name)
      end

getaddresses(name)

[Source]

    # File resolv.rb, line 202
      def self.getaddresses(name)
        DefaultResolver.getaddresses(name)
      end

getname(address)

[Source]

    # File resolv.rb, line 210
      def self.getname(address)
        DefaultResolver.getname(address)
      end

getnames(address)

[Source]

    # File resolv.rb, line 214
      def self.getnames(address)
        DefaultResolver.getnames(address)
      end

new(resolvers=[Hosts.new, DNS.new])

[Source]

    # File resolv.rb, line 222
      def initialize(resolvers=[Hosts.new, DNS.new])
        @resolvers = resolvers
      end

### Public Instance methods

each_address(name) {|name| ...}

[Source]

    # File resolv.rb, line 237
      def each_address(name)
        if AddressRegex =~ name
          yield name
          return
        end
        yielded = false
        @resolvers.each {|r|
          r.each_address(name) {|address|
            yield address.to_s
            yielded = true
          }
          return if yielded
        }
      end

each_name(address) {|name.to_s| ...}

[Source]

    # File resolv.rb, line 263
      def each_name(address)
        yielded = false
        @resolvers.each {|r|
          r.each_name(address) {|name|
            yield name.to_s
            yielded = true
          }
          return if yielded
        }
      end

getaddress(name)

[Source]

    # File resolv.rb, line 226
      def getaddress(name)
        each_address(name) {|address| return address}
        raise ResolvError.new("no address for #{name}")
      end

getaddresses(name)

[Source]

    # File resolv.rb, line 231
      def getaddresses(name)
        ret = []
        each_address(name) {|address| ret << address}
        return ret
      end

getname(address)

[Source]

    # File resolv.rb, line 252
      def getname(address)
        each_name(address) {|name| return name}
        raise ResolvError.new("no name for #{address}")
      end

getnames(address)

[Source]

    # File resolv.rb, line 257
      def getnames(address)
        ret = []
        each_name(address) {|name| ret << name}
        return ret
      end

[Validate]