class Arachni::Reactor::Tasks::Base

{#call Callable} task.

@author Tasos “Zapotek” Laskos <tasos.laskos@gmail.com>

Attributes

owner[RW]

@return [Tasks]

List managing this task.

Public Class Methods

new( &task ) click to toggle source

@param [Block] task

# File lib/arachni/reactor/tasks/base.rb, line 23
def initialize( &task )
    fail ArgumentError, 'Missing block.' if !block_given?

    @task = task
end

Public Instance Methods

call( *args ) click to toggle source

Calls the {#initialize configured} task and passes `args` and self` to it.

@abstract

# File lib/arachni/reactor/tasks/base.rb, line 32
def call( *args )
    fail NotImplementedError
end
done() click to toggle source

{Tasks#delete Removes} the task from the {#owner}'s list.

# File lib/arachni/reactor/tasks/base.rb, line 37
def done
    @owner.delete self
end
hash() click to toggle source
# File lib/arachni/reactor/tasks/base.rb, line 45
def hash
    @task.hash
end
to_proc() click to toggle source
# File lib/arachni/reactor/tasks/base.rb, line 41
def to_proc
    @task
end

Private Instance Methods

call_task( *args ) click to toggle source
# File lib/arachni/reactor/tasks/base.rb, line 51
def call_task( *args )
    @task.call *([self] + args)
end