class Redox::Connection

Constants

DEFAULT_ENDPOINT

Public Instance Methods

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

  self.class.post(endpoint, body: body, headers: headers)
end

Private Instance Methods

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

  return @auth.authenticate.access_header
end