Class: Arachni::BrowserCluster::Jobs::BrowserProvider

Inherits:
Arachni::BrowserCluster::Job show all
Defined in:
lib/arachni/browser_cluster/jobs/browser_provider.rb

Overview

Works together with Arachni::BrowserCluster#with_browser to provide the callback for this job with the Arachni::Browser assigned to this job.

Author:

Instance Attribute Summary

Attributes inherited from Arachni::BrowserCluster::Job

#args, #browser, #forwarder, #time

Instance Method Summary collapse

Methods inherited from Arachni::BrowserCluster::Job

#==, #clean_copy, #configure_and_run, #dup, #forward, #forward_as, #hash, #id, #never_ending=, #never_ending?, #save_result, #timed_out!, #timed_out?

Constructor Details

#initialize(*args) ⇒ BrowserProvider

Returns a new instance of BrowserProvider.


19
20
21
22
23
# File 'lib/arachni/browser_cluster/jobs/browser_provider.rb', line 19

def initialize( *args )
    super()

    @args = args
end

Instance Method Details

#runObject


25
26
27
# File 'lib/arachni/browser_cluster/jobs/browser_provider.rb', line 25

def run
    browser.master.callback_for( self ).call *[browser, @args].flatten.compact
end

#to_sObject Also known as: inspect


29
30
31
32
33
# File 'lib/arachni/browser_cluster/jobs/browser_provider.rb', line 29

def to_s
    "#<#{self.class}:#{object_id} " <<
        "callback=#{browser.master.callback_for( self ) if browser && browser.master} " <<
        "time=#{@time} timed_out=#{timed_out?}>"
end