Class: Nmap::XML::Hostname

Inherits:
Struct
  • Object
show all
Defined in:
lib/nmap/xml/hostname.rb

Overview

Represents a hostname.

Since:

  • 1.0.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



10
11
12
# File 'lib/nmap/xml/hostname.rb', line 10

def name
  @name
end

#typeObject

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



10
11
12
# File 'lib/nmap/xml/hostname.rb', line 10

def type
  @type
end

Instance Method Details

#ptr?Boolean

Determines if the hostname is a DNS PTR.

Returns:

  • (Boolean)

Since:

  • 0.8.0



30
31
32
# File 'lib/nmap/xml/hostname.rb', line 30

def ptr?
  self.type == 'PTR'
end

#to_sString

Converts the hostname to a String.

Returns:

  • (String)

    The name of the host.

Since:

  • 1.0.0



40
41
42
# File 'lib/nmap/xml/hostname.rb', line 40

def to_s
  self.name.to_s
end

#user?Boolean

Determines if the hostname was specified by the user.

Returns:

  • (Boolean)

Since:

  • 0.8.0



19
20
21
# File 'lib/nmap/xml/hostname.rb', line 19

def user?
  self.type == 'user'
end