lib/nmap/hostname.rb in ruby-nmap-0.7.0 vs lib/nmap/hostname.rb in ruby-nmap-0.8.0

- old
+ new

@@ -5,9 +5,31 @@ # @since 0.7.0 # class Hostname < Struct.new(:type, :name) # + # Determines if the hostname was specified by the user. + # + # @return [Boolean] + # + # @since 0.8.0 + # + def user? + self.type == 'user' + end + + # + # Determines if the hostname is a DNS `PTR`. + # + # @return [Boolean] + # + # @since 0.8.0 + # + def ptr? + self.type == 'PTR' + end + + # # Converts the hostname to a String. # # @return [String] # The name of the host. #