Class: Chartmogul::Client

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

Constant Summary collapse

BASE_URI =
'https://api.chartmogul.com'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(account_token: nil, secret_key: nil) ⇒ Client

Public: Constructor.

account_token - The String ChartMogul account token. secret_key - The String ChartMogul secret key.



11
12
13
14
# File 'lib/chartmogul/client.rb', line 11

def initialize(account_token: nil, secret_key: nil)
  @account_token = 
  @secret_key    = secret_key
end

Instance Attribute Details

#account_tokenObject (readonly)

Returns the value of attribute account_token.



5
6
7
# File 'lib/chartmogul/client.rb', line 5

def 
  @account_token
end

#secret_keyObject (readonly)

Returns the value of attribute secret_key.



5
6
7
# File 'lib/chartmogul/client.rb', line 5

def secret_key
  @secret_key
end

Instance Method Details

#customersObject

Public: Get customers API.

Returns the instance of Chartmogul::V1::Customers.



33
34
35
# File 'lib/chartmogul/client.rb', line 33

def customers
  Chartmogul::V1::Customers.new(self)
end

#importObject

Public: Get import API.

Returns the instance of Chartmogul::V1::Import.



26
27
28
# File 'lib/chartmogul/client.rb', line 26

def import
  Chartmogul::V1::Import.new(self)
end

#userpwdObject

Public: Get userpwd.

Returns the String.



19
20
21
# File 'lib/chartmogul/client.rb', line 19

def userpwd
  "#{}:#{secret_key}"
end