Class: ApiClient::Connection::Abstract
- Inherits:
-
Object
- Object
- ApiClient::Connection::Abstract
- Defined in:
- lib/api_client/connection/abstract.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#endpoint ⇒ Object
Returns the value of attribute endpoint.
-
#handler ⇒ Object
Returns the value of attribute handler.
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
- #create_handler ⇒ Object
-
#delete(path, data = {}, headers = {}) ⇒ Object
FS::Connection#delete Performs a DELETE request Accepts three parameters:.
-
#get(path, data = {}, headers = {}) ⇒ Object
ApiClient::Connection::Abstract#get Performs a GET request Accepts three parameters:.
-
#initialize(endpoint, options = {}) ⇒ Abstract
constructor
A new instance of Abstract.
- #inspect ⇒ Object (also: #to_s)
-
#patch(path, data = {}, headers = {}) ⇒ Object
ApiClient::Connection::Abstract#patch Performs a PATCH request Accepts three parameters:.
-
#post(path, data = {}, headers = {}) ⇒ Object
ApiClient::Connection::Abstract#post Performs a POST request Accepts three parameters:.
-
#put(path, data = {}, headers = {}) ⇒ Object
ApiClient::Connection::Abstract#put Performs a PUT request Accepts three parameters:.
Constructor Details
#initialize(endpoint, options = {}) ⇒ Abstract
Returns a new instance of Abstract.
9 10 11 12 13 14 |
# File 'lib/api_client/connection/abstract.rb', line 9 def initialize(endpoint, = {}) raise "Cannot instantiate abstract class" if self.class == ApiClient::Connection::Abstract @endpoint = endpoint = create_handler end |
Instance Attribute Details
#endpoint ⇒ Object
Returns the value of attribute endpoint.
7 8 9 |
# File 'lib/api_client/connection/abstract.rb', line 7 def endpoint @endpoint end |
#handler ⇒ Object
Returns the value of attribute handler.
7 8 9 |
# File 'lib/api_client/connection/abstract.rb', line 7 def handler @handler end |
#options ⇒ Object
Returns the value of attribute options.
7 8 9 |
# File 'lib/api_client/connection/abstract.rb', line 7 def end |
Instance Method Details
#create_handler ⇒ Object
16 17 |
# File 'lib/api_client/connection/abstract.rb', line 16 def create_handler end |
#delete(path, data = {}, headers = {}) ⇒ Object
FS::Connection#delete Performs a DELETE request Accepts three parameters:
-
path - the path request should go to
-
data - (optional) the query, passed as a hash and converted into query params
-
headers - (optional) headers sent along in the request
71 72 |
# File 'lib/api_client/connection/abstract.rb', line 71 def delete(path, data = {}, headers = {}) end |
#get(path, data = {}, headers = {}) ⇒ Object
ApiClient::Connection::Abstract#get Performs a GET request Accepts three parameters:
-
path - the path the request should go to
-
data - (optional) the query, passed as a hash and converted into query params
-
headers - (optional) headers sent along with the request
27 28 |
# File 'lib/api_client/connection/abstract.rb', line 27 def get(path, data = {}, headers = {}) end |
#inspect ⇒ Object Also known as: to_s
74 75 76 |
# File 'lib/api_client/connection/abstract.rb', line 74 def inspect "#<#{self.class} endpoint: \"#{endpoint}\">" end |
#patch(path, data = {}, headers = {}) ⇒ Object
ApiClient::Connection::Abstract#patch Performs a PATCH request Accepts three parameters:
-
path - the path request should go to
-
data - (optional) data sent in the request
-
headers - (optional) headers sent along in the request
49 50 |
# File 'lib/api_client/connection/abstract.rb', line 49 def patch(path, data = {}, headers = {}) end |
#post(path, data = {}, headers = {}) ⇒ Object
ApiClient::Connection::Abstract#post Performs a POST request Accepts three parameters:
-
path - the path request should go to
-
data - (optional) data sent in the request
-
headers - (optional) headers sent along in the request
38 39 |
# File 'lib/api_client/connection/abstract.rb', line 38 def post(path, data = {}, headers = {}) end |
#put(path, data = {}, headers = {}) ⇒ Object
ApiClient::Connection::Abstract#put Performs a PUT request Accepts three parameters:
-
path - the path request should go to
-
data - (optional) data sent in the request
-
headers - (optional) headers sent along in the request
60 61 |
# File 'lib/api_client/connection/abstract.rb', line 60 def put(path, data = {}, headers = {}) end |