class Arachni::Reactor::Tasks
{Tasks::Base Task} list.
@author Tasos “Zapotek” Laskos <tasos.laskos@gmail.com>
Public Class Methods
new()
click to toggle source
Calls superclass method
# File lib/arachni/reactor/tasks.rb, line 26 def initialize super @tasks = [] end
Public Instance Methods
<<( task )
click to toggle source
@note Only {Base#hash unique} tasks will be included. @note Will assign `self` as the task's {Base#owner owner}.
@param [Base] task
Task to add to the list.
@return [Tasks] `self`
# File lib/arachni/reactor/tasks.rb, line 38 def <<( task ) synchronize do task.owner = self @tasks << task end self end
any?()
click to toggle source
@return [Bool]
# File lib/arachni/reactor/tasks.rb, line 77 def any? !empty? end
call( *args )
click to toggle source
{Base#call Calls} all tasks.
@return [Tasks] `self`
# File lib/arachni/reactor/tasks.rb, line 95 def call( *args ) @tasks.dup.each { |t| t.call *args } self end
clear()
click to toggle source
Removes all tasks.
@return [Tasks] `self`
# File lib/arachni/reactor/tasks.rb, line 84 def clear synchronize do @tasks.clear end self end
delete( task )
click to toggle source
@param [Base] task
Task to remove from the list.
@return [Base,nil]
The task if it was included, `nil` otherwise.
# File lib/arachni/reactor/tasks.rb, line 58 def delete( task ) synchronize do task = @tasks.delete( task ) task.owner = nil if task task end end
empty?()
click to toggle source
@return [Bool]
# File lib/arachni/reactor/tasks.rb, line 72 def empty? @tasks.empty? end
hash()
click to toggle source
# File lib/arachni/reactor/tasks.rb, line 100 def hash @tasks.hash end
include?( task )
click to toggle source
@param [Base] task
Task to check.
@return [Bool]
# File lib/arachni/reactor/tasks.rb, line 50 def include?( task ) @tasks.include? task end
size()
click to toggle source
@return [Integer]
# File lib/arachni/reactor/tasks.rb, line 67 def size @tasks.size end