Class: Nmap::Hostname
- Inherits:
-
Struct
- Object
- Struct
- Nmap::Hostname
- Defined in:
- lib/nmap/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
7 8 9 |
# File 'lib/nmap/hostname.rb', line 7 def name @name end |
#type ⇒ Object
Returns the value of attribute 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
.
27 28 29 |
# File 'lib/nmap/hostname.rb', line 27 def ptr? self.type == 'PTR' end |
#to_s ⇒ String
Converts the hostname to a String.
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.
16 17 18 |
# File 'lib/nmap/hostname.rb', line 16 def user? self.type == 'user' end |