Class: Nmap::Hostname

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

Overview

Represents a hostname.

Since:

  • 0.7.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



7
8
9
# File 'lib/nmap/hostname.rb', line 7

def name
  @name
end

#typeObject

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



7
8
9
# File 'lib/nmap/hostname.rb', line 7

def type
  @type
end

Instance Method Details

#ptr?Boolean

Determines if the hostname is a DNS PTR.

Returns:

  • (Boolean)

Since:

  • 0.8.0



27
28
29
# File 'lib/nmap/hostname.rb', line 27

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

#to_sString

Converts the hostname to a String.

Returns:

  • (String)

    The name of the host.

Since:

  • 0.7.0



37
38
39
# File 'lib/nmap/hostname.rb', line 37

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



16
17
18
# File 'lib/nmap/hostname.rb', line 16

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