Class: SolidusTiny::TinyClient
- Inherits:
-
TinyErpApi::Client
- Object
- TinyErpApi::Client
- SolidusTiny::TinyClient
- Defined in:
- app/models/solidus_tiny/tiny_client.rb
Instance Attribute Summary collapse
-
#account ⇒ Object
Returns the value of attribute account.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(account) ⇒ TinyClient
constructor
A new instance of TinyClient.
- #refresh_token ⇒ Object
Constructor Details
#initialize(account) ⇒ TinyClient
Returns a new instance of TinyClient.
8 9 10 11 12 13 14 15 16 17 |
# File 'app/models/solidus_tiny/tiny_client.rb', line 8 def initialize(account) @account = account super( client_id: account.client_id, client_secret: account.client_secret, refresh: account.refresh_token, access_token: account.access_token, token_expires_at: account.token_expires_in ) end |
Instance Attribute Details
#account ⇒ Object
Returns the value of attribute account.
7 8 9 |
# File 'app/models/solidus_tiny/tiny_client.rb', line 7 def account @account end |
Class Method Details
.for_account(account) ⇒ Object
3 4 5 |
# File 'app/models/solidus_tiny/tiny_client.rb', line 3 def self.for_account(account) self.new(account) end |
Instance Method Details
#refresh_token ⇒ Object
19 20 21 22 |
# File 'app/models/solidus_tiny/tiny_client.rb', line 19 def refresh_token super sync_account_tokens end |