Sha256: 68d47db02319f3b8f74f112939d5e3cdc81c3fc641d1b73e0bcace7c30f1b1e2

Contents?: true

Size: 1.14 KB

Versions: 3

Compression:

Stored size: 1.14 KB

Contents

module Nmap
  class XML
    #
    # @since 1.0.0
    #
    class ScanTask < Struct.new(:name, :start_time, :end_time, :extra_info)

      #
      # Creates a new ScanTask object.
      #
      # @param [String] name
      #   The name of the scan task.
      #
      # @param [Time] start_time
      #   The time the scan task begun.
      #
      # @param [Time] end_time
      #   The time the scan task ended.
      #
      # @param [String] extra_info
      #   Any extra information relating to the scan task.
      #
      # @since 0.1.2
      #
      def initialize(name,start_time,end_time,extra_info=nil)
        super
      end

      #
      # The duration of the scan task.
      #
      # @return [Integer]
      #   The number of seconds it took the scan task to complete.
      #
      # @since 0.1.2
      #
      def duration
        (self.end_time - self.start_time)
      end

      #
      # Converts the scan task to a String.
      #
      # @return [String]
      #   The String form of the scan task.
      #
      # @since 0.1.2
      #
      def to_s
        "#{self.start_time}: #{self.name} (#{self.extra_info})"
      end

    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ruby-nmap-1.0.2 lib/nmap/xml/scan_task.rb
ruby-nmap-1.0.1 lib/nmap/xml/scan_task.rb
ruby-nmap-1.0.0 lib/nmap/xml/scan_task.rb