Class: Updox::Connection
- Inherits:
-
Object
- Object
- Updox::Connection
- Includes:
- HTTParty
- Defined in:
- lib/updox/connection.rb
Constant Summary collapse
- URI_BUILDER =
->(host) { "https://#{host}/api/io/".freeze }
- QA_ENDPOINT =
URI_BUILDER.call('updoxqa.com')
- PROD_ENDPOINT =
URI_BUILDER.call('myupdox.com')
Instance Method Summary collapse
Instance Method Details
#request(endpoint: Updox::Models::Auth::PING_ENDPOINT, body: {}, headers: {}, auth: Updox::Models::Auth.new, required_auths: [], account_id: nil, user_id: nil) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/updox/connection.rb', line 16 def request(endpoint: Updox::Models::Auth::PING_ENDPOINT, body: {}, headers: {}, auth: Updox::Models::Auth.new, required_auths: [], account_id: nil, user_id: nil) if body.is_a?(Hash) auth[:accountId] = account_id unless account_id.nil? auth[:userId] = user_id unless user_id.nil? body = auth_data(auth, required_auths).merge(body) body = body.to_json end self.class.post(endpoint, body: body, headers: headers) end |