Class: Async::Webdriver::Execute

Inherits:
Object
  • Object
show all
Defined in:
lib/async/webdriver/execute.rb

Instance Method Summary collapse

Constructor Details

#initialize(connection:) ⇒ Execute

Returns a new instance of Execute.



4
5
6
# File 'lib/async/webdriver/execute.rb', line 4

def initialize(connection:)
  @execute_connection = ConnectionPath.new "execute", connection: connection
end

Instance Method Details

#async(script, args = []) ⇒ Object



18
19
20
21
22
23
24
25
26
# File 'lib/async/webdriver/execute.rb', line 18

def async(script, args=[])
  #TODO: args?
  body = {
    script: script,
    args: args
  }

  @execute_connection.call method: "post", path: "async", body: body
end

#sync(script, args = []) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'lib/async/webdriver/execute.rb', line 8

def sync(script, args=[])
  #TODO: args?
  body = {
    script: script,
    args: args
  }

  @execute_connection.call method: "post", path: "sync", body: body
end