lib/nmap/xml.rb in ruby-nmap-0.9.3 vs lib/nmap/xml.rb in ruby-nmap-0.10.0
- old
+ new
@@ -240,9 +240,24 @@
def tasks
each_task.to_a
end
#
+ # Finds the task with the given name.
+ #
+ # @param [String] name
+ # The task name to search for.
+ #
+ # @return [ScanTask, nil]
+ # The scan task with the matching name or `nil`.
+ #
+ # @since 0.10.0
+ #
+ def task(name)
+ each_task.find { |scan_task| scan_task.name == name }
+ end
+
+ #
# The NSE scripts ran before the scan.
#
# @return [Prescript]
# Contains the script output and data.
#