Class: Webdriver::PrefixConnection
- Inherits:
-
Object
- Object
- Webdriver::PrefixConnection
- Defined in:
- lib/webdriver/prefix_connection.rb
Instance Method Summary collapse
- #call(method, path = nil, headers = {}, body = nil) ⇒ Object
- #delete(path = nil, headers = {}, body = nil) ⇒ Object
- #get(path, headers = {}) ⇒ Object
-
#initialize(prefix, connection) ⇒ PrefixConnection
constructor
A new instance of PrefixConnection.
- #post(path = nil, headers = {}, body = nil) ⇒ Object
Constructor Details
#initialize(prefix, connection) ⇒ PrefixConnection
Returns a new instance of PrefixConnection.
3 4 5 6 |
# File 'lib/webdriver/prefix_connection.rb', line 3 def initialize(prefix, connection) @prefix = prefix @connection = connection end |
Instance Method Details
#call(method, path = nil, headers = {}, body = nil) ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/webdriver/prefix_connection.rb', line 18 def call(method, path=nil, headers={}, body=nil) prefixed_path = if path "#{@prefix}/#{path}" else "#{@prefix}" end @connection.call method, prefixed_path, headers, body end |
#delete(path = nil, headers = {}, body = nil) ⇒ Object
14 15 16 |
# File 'lib/webdriver/prefix_connection.rb', line 14 def delete(path=nil, headers={}, body=nil) call :delete, path, headers, body end |
#get(path, headers = {}) ⇒ Object
8 9 10 |
# File 'lib/webdriver/prefix_connection.rb', line 8 def get(path, headers={}) call :get, path, headers end |
#post(path = nil, headers = {}, body = nil) ⇒ Object
11 12 13 |
# File 'lib/webdriver/prefix_connection.rb', line 11 def post(path=nil, headers={}, body=nil) call :post, path, headers, body end |