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)
-
#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.
12 13 14 15 16 17 |
# File 'lib/api_client/connection/abstract.rb', line 12 def initialize(endpoint, = {}) raise "Cannot instantiate abstract class" if self.class == ApiClient::Connection::Abstract @endpoint = endpoint @options = create_handler end |
Instance Attribute Details
#endpoint ⇒ Object
Returns the value of attribute endpoint.
10 11 12 |
# File 'lib/api_client/connection/abstract.rb', line 10 def endpoint @endpoint end |
#handler ⇒ Object
Returns the value of attribute handler.
10 11 12 |
# File 'lib/api_client/connection/abstract.rb', line 10 def handler @handler end |
#options ⇒ Object
Returns the value of attribute options.
10 11 12 |
# File 'lib/api_client/connection/abstract.rb', line 10 def @options end |
Instance Method Details
#create_handler ⇒ Object
19 20 |
# File 'lib/api_client/connection/abstract.rb', line 19 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
63 64 |
# File 'lib/api_client/connection/abstract.rb', line 63 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
30 31 |
# File 'lib/api_client/connection/abstract.rb', line 30 def get(path, data = {}, headers = {}) end |
#inspect ⇒ Object Also known as: to_s
66 67 68 |
# File 'lib/api_client/connection/abstract.rb', line 66 def inspect "#<#{self.class} endpoint: \"#{endpoint}\">" 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
41 42 |
# File 'lib/api_client/connection/abstract.rb', line 41 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
52 53 |
# File 'lib/api_client/connection/abstract.rb', line 52 def put(path, data = {}, headers = {}) end |