Class: Lightspeed::Client
- Inherits:
-
Object
- Object
- Lightspeed::Client
- Defined in:
- lib/lightspeed/client.rb
Constant Summary collapse
- API_BASE =
"https://api.merchantos.com/API"
Instance Attribute Summary collapse
-
#access_token ⇒ Object
readonly
Returns the value of attribute access_token.
-
#client_id ⇒ Object
readonly
Returns the value of attribute client_id.
-
#client_secret ⇒ Object
readonly
Returns the value of attribute client_secret.
-
#refresh_token ⇒ Object
readonly
Returns the value of attribute refresh_token.
Instance Method Summary collapse
-
#initialize(client_id:, client_secret:, access_token:, refresh_token:) ⇒ Client
constructor
A new instance of Client.
- #tokens ⇒ Object
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_token ⇒ Object (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_id ⇒ Object (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_secret ⇒ Object (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_token ⇒ Object (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
#tokens ⇒ Object
16 |
# File 'lib/lightspeed/client.rb', line 16 def tokens; API::Tokens.new(self); end |