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.



12
13
14
15
16
17
# File 'lib/api_client/connection/abstract.rb', line 12

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.



10
11
12
# File 'lib/api_client/connection/abstract.rb', line 10

def endpoint
  @endpoint
end

#handlerObject

Returns the value of attribute handler.



10
11
12
# File 'lib/api_client/connection/abstract.rb', line 10

def handler
  @handler
end

#optionsObject

Returns the value of attribute options.



10
11
12
# File 'lib/api_client/connection/abstract.rb', line 10

def options
  @options
end

Instance Method Details

#create_handlerObject



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

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