Sha256: a688aba875b062d15af54526672fbe24fe4adc5fc9d73561dea8e2675d740f34

Contents?: true

Size: 617 Bytes

Versions: 6

Compression:

Stored size: 617 Bytes

Contents

module Nmap
  #
  # Represents a hostname.
  #
  # @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.
    #
    def to_s
      self.name.to_s
    end

  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ruby-nmap-0.10.0 lib/nmap/hostname.rb
ruby-nmap-0.9.3 lib/nmap/hostname.rb
ruby-nmap-0.9.2 lib/nmap/hostname.rb
ruby-nmap-0.9.1 lib/nmap/hostname.rb
ruby-nmap-0.9.0 lib/nmap/hostname.rb
ruby-nmap-0.8.0 lib/nmap/hostname.rb