Class: GeniusReferrals::GeniusReferralsClient

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

Overview

Backward-compatible class name for callers of the older generated gem.

Instance Attribute Summary

Attributes inherited from Client

#accounts, #advocates, #auth_token, #authentications, #backoff_factor, #base_url, #bonuses, #campaigns, #max_retries, #products, #redemption_requests, #referrals, #reports, #root, #tags, #timeout, #transport, #user_agent, #utilities, #vouchers, #widgets_packages

Instance Method Summary collapse

Methods inherited from Client

#build_request, #request

Constructor Details

#initialize(content_type = 'application/json', x_auth_token = nil, **options) ⇒ GeniusReferralsClient

Returns a new instance of GeniusReferralsClient.



159
160
161
162
163
164
165
166
167
# File 'lib/genius_referrals/client.rb', line 159

def initialize(content_type = 'application/json', x_auth_token = nil, **options)
  if content_type.is_a?(Hash)
    options = content_type.merge(options)
  end

  x_auth_token = options.delete(:x_auth_token) || options.delete('x_auth_token') || x_auth_token
  token = options.delete(:auth_token) || x_auth_token
  super(auth_token: token, **options)
end