Class: PipelineDealsApi::HttpClient

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

Defined Under Namespace

Classes: BadGatewayError, BadRequestError, ClientError, ConflictError, ForbiddenError, GatewayTimeoutError, InternalServerError, MethodNotAllowed, NotFoundError, PaymentRequiredError, RequestTimeoutError, RequestURITooLongError, Response, ResponseError, ServerError, ServiceUnavailableError, TooManyRequestsError, UnauthorizedError, UnknownError, UnprocessableEntityError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(credentials:) ⇒ HttpClient

Returns a new instance of HttpClient.



5
6
7
# File 'lib/pipeline_deals_api/http_client.rb', line 5

def initialize(credentials:)
  @credentials = credentials
end

Instance Attribute Details

#credentialsObject (readonly)

Returns the value of attribute credentials.



3
4
5
# File 'lib/pipeline_deals_api/http_client.rb', line 3

def credentials
  @credentials
end

Instance Method Details

#delete(url, body = {}, headers = {}) ⇒ Object



21
22
23
# File 'lib/pipeline_deals_api/http_client.rb', line 21

def delete(url, body = {}, headers = {})
  http_request(:delete, url, body, headers)
end

#get(url, body = {}, headers = {}) ⇒ Object



9
10
11
# File 'lib/pipeline_deals_api/http_client.rb', line 9

def get(url, body = {}, headers = {})
  http_request(:get, url, body, headers)
end

#post(url, body = {}, headers = {}) ⇒ Object



17
18
19
# File 'lib/pipeline_deals_api/http_client.rb', line 17

def post(url, body = {}, headers = {})
  http_request(:post, url, body, headers)
end

#put(url, body = {}, headers = {}) ⇒ Object



13
14
15
# File 'lib/pipeline_deals_api/http_client.rb', line 13

def put(url, body = {}, headers = {})
  http_request(:put, url, body, headers)
end