module WebDriverScriptAdapter::ScriptWriter

Public Instance Methods

async_results_identifier() click to toggle source
# File lib/webdriver_script_adapter/execute_async_script_adapter.rb, line 48
def async_results_identifier
  id = WebDriverScriptAdapter.async_results_identifier
  "window['#{id.respond_to?(:call) ? id.call : id}']"
end
async_wrapper(script, *args) click to toggle source
# File lib/webdriver_script_adapter/execute_async_script_adapter.rb, line 57
def async_wrapper(script, *args)
  "(function(){ #{script} })(#{args.join(', ')});"
end
callback(resultsIdentifier) click to toggle source
# File lib/webdriver_script_adapter/execute_async_script_adapter.rb, line 53
def callback(resultsIdentifier)
  "function(err, returnValue){ #{resultsIdentifier} = (err || returnValue); }"
end