Class: Lightspeed::Client

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

Constant Summary collapse

API_BASE =
"https://api.merchantos.com/API"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client_id:, client_secret:, access_token:, refresh_token:) ⇒ Client

Returns a new instance of Client.



9
10
11
12
13
14
# File 'lib/lightspeed/client.rb', line 9

def initialize(client_id:, client_secret:, access_token:, refresh_token:)
  @client_id = client_id
  @client_secret = client_secret
  @access_token = access_token
  @refresh_token = refresh_token
end

Instance Attribute Details

#access_tokenObject (readonly)

Returns the value of attribute access_token.



7
8
9
# File 'lib/lightspeed/client.rb', line 7

def access_token
  @access_token
end

#client_idObject (readonly)

Returns the value of attribute client_id.



7
8
9
# File 'lib/lightspeed/client.rb', line 7

def client_id
  @client_id
end

#client_secretObject (readonly)

Returns the value of attribute client_secret.



7
8
9
# File 'lib/lightspeed/client.rb', line 7

def client_secret
  @client_secret
end

#refresh_tokenObject (readonly)

Returns the value of attribute refresh_token.



7
8
9
# File 'lib/lightspeed/client.rb', line 7

def refresh_token
  @refresh_token
end

Instance Method Details

#tokensObject



16
# File 'lib/lightspeed/client.rb', line 16

def tokens; API::Tokens.new(self); end