class ChangeHealth::Connection

Constants

PROD_ENDPOINT
QA_ENDPOINT
URI_BUILDER

Public Instance Methods

request(endpoint: , query: nil, body: nil, headers: {}, auth: true, verb: :post) click to toggle source
# File lib/change_health/connection.rb, line 16
def request(endpoint: , query: nil, body: nil, headers: {}, auth: true, verb: :post)
  body    = body.to_json if body.is_a?(Hash)
  headers = auth_header.merge(headers) if auth

  self.class.send("#{verb}", endpoint, query: query, body: body, headers: headers)
end

Private Instance Methods

auth_header() click to toggle source
# File lib/change_health/connection.rb, line 25
def auth_header
  @auth ||= Authentication.new

  return @auth.authenticate.access_header
end