class Axe::API::Run
Constants
- JS_NAME
- METHOD_NAME
Public Class Methods
new()
click to toggle source
# File lib/axe/api/run.rb, line 26 def initialize @context = Context.new @options = Options.new end
Public Instance Methods
call(page)
click to toggle source
# File lib/axe/api/run.rb, line 31 def call(page) audit page do |results| Audit.new to_js, Results.new(results) end end
Private Instance Methods
audit(page) { |execute_async_script "#{METHOD_NAME}.apply(#{JS_NAME}, arguments)", *js_args| ... }
click to toggle source
# File lib/axe/api/run.rb, line 39 def audit(page) yield page.execute_async_script "#{METHOD_NAME}.apply(#{Core::JS_NAME}, arguments)", *js_args end
js_args()
click to toggle source
# File lib/axe/api/run.rb, line 43 def js_args [@context, @options] .reject(&:empty?) .map(&:to_json) end
to_js()
click to toggle source
# File lib/axe/api/run.rb, line 49 def to_js str_args = (js_args + ['callback']).join(', ') "#{METHOD_NAME}(#{str_args});" end