Class: Overlay::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/overlay/client.rb

Instance Method Summary collapse

Constructor Details

#initialize(api_key: Config.api_key, auth_key: Config.auth_key, base_url: Config.base_url) ⇒ Client

Returns a new instance of Client.



6
7
8
9
10
# File 'lib/overlay/client.rb', line 6

def initialize(api_key: Config.api_key, auth_key: Config.auth_key, base_url: Config.base_url)
  @api_key = api_key
  @auth_key = auth_key
  @base_url = base_url
end

Instance Method Details

#post(path, payload) ⇒ Object



12
13
14
15
# File 'lib/overlay/client.rb', line 12

def post(path, payload)
  res = HTTPX.with_headers(headers).post("#{@base_url}#{path}", json: payload)
  handle_response(res)
end