Module: DebounceIo::Client

Extended by:
Client
Included in:
Client
Defined in:
lib/debounce_io/client.rb

Constant Summary collapse

BASE_ENDPOINT =
'https://api.debounce.io/v1/'
API_KEY =
ENV.fetch('DEBOUNCE_IO_API_KEY') { '' }

Instance Method Summary collapse

Instance Method Details

#get(path: '', params: {}) ⇒ Object



13
14
15
16
17
18
# File 'lib/debounce_io/client.rb', line 13

def get(path: '', params: {})
  build_request_uri(path, params)
    .then { |uri| submit(uri) }
    .then { |response| decode(response.body) }
    .then { |response| validate(response) }
end