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
8 9 10 |
# File 'lib/nmap/xml/hostname.rb', line 8 def name @name end |
#type ⇒ Object
Returns the value of attribute type
8 9 10 |
# File 'lib/nmap/xml/hostname.rb', line 8 def type @type end |
Instance Method Details
#ptr? ⇒ Boolean
Determines if the hostname is a DNS PTR.
28 29 30 |
# File 'lib/nmap/xml/hostname.rb', line 28 def ptr? self.type == 'PTR' end |
#to_s ⇒ String
Converts the hostname to a String.
38 39 40 |
# File 'lib/nmap/xml/hostname.rb', line 38 def to_s self.name.to_s end |
#user? ⇒ Boolean
Determines if the hostname was specified by the user.
17 18 19 |
# File 'lib/nmap/xml/hostname.rb', line 17 def user? self.type == 'user' end |