Class: Commercelayer::Client

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

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Client

Returns a new instance of Client.



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

def initialize(options={})
  @client_id = options[:client_id]
  @client_secret = options[:client_secret]
  @scope = options[:scope]
  @site = options[:site]
end

Instance Method Details

#authorize!Object



13
14
15
16
# File 'lib/commercelayer/client.rb', line 13

def authorize!
  Resource.site = @site + "/api/"
  Resource.authorize_with = get_access_token
end