Class: Arachni::Reactor::Tasks::Base
- Inherits:
-
Object
- Object
- Arachni::Reactor::Tasks::Base
- Defined in:
- lib/arachni/reactor/tasks/base.rb
Overview
Callable task.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#owner ⇒ Tasks
List managing this task.
Instance Method Summary collapse
-
#call(*args) ⇒ Object
abstract
Calls the configured task and passes
args
and self` to it. - #done ⇒ Object
- #hash ⇒ Object
-
#initialize(&task) ⇒ Base
constructor
A new instance of Base.
- #to_proc ⇒ Object
Constructor Details
#initialize(&task) ⇒ Base
Returns a new instance of Base.
23 24 25 26 27 |
# File 'lib/arachni/reactor/tasks/base.rb', line 23 def initialize( &task ) fail ArgumentError, 'Missing block.' if !block_given? @task = task end |
Instance Attribute Details
#owner ⇒ Tasks
Returns List managing this task.
20 21 22 |
# File 'lib/arachni/reactor/tasks/base.rb', line 20 def owner @owner end |
Instance Method Details
#call(*args) ⇒ Object
This method is abstract.
Calls the configured task and passes args
and self` to it.
32 33 34 |
# File 'lib/arachni/reactor/tasks/base.rb', line 32 def call( *args ) fail NotImplementedError end |
#done ⇒ Object
37 38 39 |
# File 'lib/arachni/reactor/tasks/base.rb', line 37 def done @owner.delete self end |
#hash ⇒ Object
45 46 47 |
# File 'lib/arachni/reactor/tasks/base.rb', line 45 def hash @task.hash end |
#to_proc ⇒ Object
41 42 43 |
# File 'lib/arachni/reactor/tasks/base.rb', line 41 def to_proc @task end |