Sha256: e8e89765ffc1de44efb9fe6654ac0ffe5799afe2e49e4097ca998241c57cf4d8

Contents?: true

Size: 1.25 KB

Versions: 1

Compression:

Stored size: 1.25 KB

Contents

require 'time'

module Nikto
  class XML
    #
    # Represents a `statistics` XML element.
    #
    class Statistics

      #
      # Initializes the statistics object.
      #
      # @param [Nokogiri::XML::Node] node
      #   The XML node for the `statistics` XML element.
      #
      # @api private
      #
      def initialize(node)
        @node = node
      end

      #
      # The number of seconds elapsed.
      #
      # @return [Intger]
      #   The parsed value of the `elapsed` attribute.
      #
      def elapsed
        @elapsed ||= @node['elapsed'].to_i
      end

      #
      # The number of items found.
      #
      # @return [Intger]
      #   The parsed value of the `itemsfound` attribute.
      #
      def items_found
        @items_found ||= @node['itemsfound'].to_i
      end

      #
      # The number of items tested.
      #
      # @return [Intger]
      #   The parsed value of the `itemstested` attribute.
      #
      def items_tested
        @items_tested ||= @node['itemstested'].to_i
      end

      #
      # The end-time of the scan.
      #
      # @return [Time]
      #   The parsed value of the `endtime` attribute.
      #
      def end_time
        @end_time ||= Time.parse(@node['endtime'])
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ruby-nikto-0.1.0 lib/nikto/xml/statistics.rb