Class: SoapyCake::Client

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

Direct Known Subclasses

Admin, AdminAddedit, AdminTrack, Affiliate

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ Client

Returns a new instance of Client.



5
6
7
8
9
10
11
# File 'lib/soapy_cake/client.rb', line 5

def initialize(opts = {})
  @domain = opts.fetch(:domain, ENV['CAKE_DOMAIN']) || fail(Error, 'Cake domain missing')
  @api_key = opts.fetch(:api_key, ENV['CAKE_API_KEY']) || fail(Error, 'Cake API key missing')
  @time_offset = opts.fetch(:time_offset, ENV['CAKE_TIME_OFFSET']) ||
    fail(Error, 'Cake time offset missing')
  @opts = opts
end

Instance Attribute Details

#api_keyObject (readonly)

Returns the value of attribute api_key.



3
4
5
# File 'lib/soapy_cake/client.rb', line 3

def api_key
  @api_key
end

#domainObject (readonly)

Returns the value of attribute domain.



3
4
5
# File 'lib/soapy_cake/client.rb', line 3

def domain
  @domain
end

#time_offsetObject (readonly)

Returns the value of attribute time_offset.



3
4
5
# File 'lib/soapy_cake/client.rb', line 3

def time_offset
  @time_offset
end