class Zype::LoginClient

Public Class Methods

new(_ = '') click to toggle source
# File lib/zype/client/login_client.rb, line 3
def initialize(_ = '')
  @headers = { 'Content-Type' => 'application/json' }
  self.class.base_uri Zype.configuration.login_host
end

Public Instance Methods

execute(method:, path:, params: {}) click to toggle source
# File lib/zype/client/login_client.rb, line 8
def execute(method:, path:, params: {})
  resp = send(method, path: path, params: params)
  if resp.success?
    resp['response'].nil? ? resp.parsed_response : resp['response']
  else
    error!(code: resp.code, message: resp['message'])
  end
end