Class: ApiClient::Connection::Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/api_client/connection/abstract.rb

Direct Known Subclasses

Basic

Instance Attribute Summary collapse

Instance Method Summary collapse

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, options = {})
  raise "Cannot instantiate abstract class" if self.class == ApiClient::Connection::Abstract
  @endpoint = endpoint
  @options  = options
  create_handler
end

Instance Attribute Details

#endpointObject

Returns the value of attribute endpoint.



7
8
9
# File 'lib/api_client/connection/abstract.rb', line 7

def endpoint
  @endpoint
end

#handlerObject

Returns the value of attribute handler.



7
8
9
# File 'lib/api_client/connection/abstract.rb', line 7

def handler
  @handler
end

#optionsObject

Returns the value of attribute options.



7
8
9
# File 'lib/api_client/connection/abstract.rb', line 7

def options
  @options
end

Instance Method Details

#create_handlerObject



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

#inspectObject 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