lib/nmap/scanner.rb in ruby-nmap-0.5.1 vs lib/nmap/scanner.rb in ruby-nmap-0.6.0
- old
+ new
@@ -1,49 +1,18 @@
module Nmap
- class Scanner
+ #
+ # Describes the `nmap` command.
+ #
+ class Scanner < Struct.new(:name, :version, :arguments, :start_time)
- # The name of the scanner
- attr_reader :name
-
- # The version of the scanner
- attr_reader :version
-
- # The arguments used with the scanner
- attr_reader :arguments
-
- # The time the scan begun
- attr_reader :start_time
-
#
- # Creates a new Scanner object.
- #
- # @param [String] name
- # The name of the scanner.
- #
- # @param [String] version
- # The version of the scanner.
- #
- # @param [String] arguments
- # The arguments used with the scanner.
- #
- # @param [Time] start_time
- # The time the scan begun
- #
- def initialize(name,version,arguments,start_time)
- @name = name
- @version = version
- @arguments = arguments
- @start_time = start_time
- end
-
- #
# Converts the scanner to a String.
#
# @return [String]
# The scanner name and arguments.
#
def to_s
- "#{@name} #{@arguments}"
+ "#{self.name} #{self.arguments}"
end
end
end