Class: SemaphoreClient::HttpClient

Inherits:
Object
  • Object
show all
Defined in:
lib/semaphore_client/http_client.rb

Defined Under Namespace

Classes: ResponseErrorMiddleware

Instance Method Summary collapse

Constructor Details

#initialize(auth_token, api_url, api_version, logger, auto_paginate) ⇒ HttpClient

Returns a new instance of HttpClient.



28
29
30
31
32
33
34
# File 'lib/semaphore_client/http_client.rb', line 28

def initialize(auth_token, api_url, api_version, logger, auto_paginate)
  @auth_token = auth_token
  @api_url = api_url
  @api_version = api_version
  @logger = logger
  @auto_paginate = auto_paginate
end

Instance Method Details

#delete(path, params = nil, options = {}) ⇒ Object



48
49
50
# File 'lib/semaphore_client/http_client.rb', line 48

def delete(path, params = nil, options = {})
  api_call(:delete, path, params, options)
end

#get(path, params = nil, options = {}) ⇒ Object



36
37
38
# File 'lib/semaphore_client/http_client.rb', line 36

def get(path, params = nil, options = {})
  api_call(:get, path, params, options)
end

#patch(path, params = nil, options = {}) ⇒ Object



44
45
46
# File 'lib/semaphore_client/http_client.rb', line 44

def patch(path, params = nil, options = {})
  api_call(:patch, path, params, options)
end

#post(path, params = nil, options = {}) ⇒ Object



40
41
42
# File 'lib/semaphore_client/http_client.rb', line 40

def post(path, params = nil, options = {})
  api_call(:post, path, params, options)
end