Class: Async::Webdriver::ConnectionPath
- Inherits:
-
Object
- Object
- Async::Webdriver::ConnectionPath
- Defined in:
- lib/async/webdriver/connection_path.rb
Instance Method Summary collapse
- #call(method:, path: nil, headers: [], body: nil) ⇒ Object
-
#initialize(prefix, connection:) ⇒ ConnectionPath
constructor
A new instance of ConnectionPath.
Constructor Details
#initialize(prefix, connection:) ⇒ ConnectionPath
Returns a new instance of ConnectionPath.
9 10 11 12 |
# File 'lib/async/webdriver/connection_path.rb', line 9 def initialize(prefix, connection:) @connection = connection @prefix = prefix end |
Instance Method Details
#call(method:, path: nil, headers: [], body: nil) ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/async/webdriver/connection_path.rb', line 14 def call(method:, path:nil, headers:[], body:nil) connection_path = if path "#{@prefix}/#{path}" else "#{@prefix}" end @connection.call method: method, path: connection_path, headers: headers, body: body end |