Class: Nmap::XML::Hostname
- Inherits:
-
Struct
- Object
- Struct
- Nmap::XML::Hostname
- Defined in:
- lib/nmap/xml/hostname.rb
Overview
Represents a hostname.
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#ptr? ⇒ Boolean
Determines if the hostname is a DNS
PTR
. -
#to_s ⇒ String
Converts the hostname to a String.
-
#user? ⇒ Boolean
Determines if the hostname was specified by the user.
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name
10 11 12 |
# File 'lib/nmap/xml/hostname.rb', line 10 def name @name end |
#type ⇒ Object
Returns the value of attribute 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
.
30 31 32 |
# File 'lib/nmap/xml/hostname.rb', line 30 def ptr? self.type == 'PTR' end |
#to_s ⇒ String
Converts the hostname to a String.
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.
19 20 21 |
# File 'lib/nmap/xml/hostname.rb', line 19 def user? self.type == 'user' end |