Class: Whois::Parser::Nameserver

Inherits:
Object
  • Object
show all
Defined in:
lib/whois/parser/nameserver.rb

Overview

Holds the details of the Name Servers extracted from the WHOIS response.

A name server is composed by the several attributes, accessible through corresponding getter / setter methods.

Please note that a response is not required to provide all the attributes. When an attribute is not available, the corresponding value is set to nil.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#ipv4String

Returns the current value of ipv4.

Returns:

  • (String)

    the current value of ipv4



20
21
22
# File 'lib/whois/parser/nameserver.rb', line 20

def ipv4
  @ipv4
end

#ipv6String

Returns the current value of ipv6.

Returns:

  • (String)

    the current value of ipv6



20
21
22
# File 'lib/whois/parser/nameserver.rb', line 20

def ipv6
  @ipv6
end

#nameString

Returns the current value of name.

Returns:

  • (String)

    the current value of name



20
21
22
# File 'lib/whois/parser/nameserver.rb', line 20

def name
  @name
end

Instance Method Details

#to_sString

Returns a string representation of this object composed by the host name.

Examples:

Nameserver.new(:name => "ns.example.com").to_s
# => "ns.example.com"
Nameserver.new.to_s
# => ""

Returns:

  • (String)

    The string representation.



32
33
34
# File 'lib/whois/parser/nameserver.rb', line 32

def to_s
  name.to_s
end