Class: Finicity::Fetchers::Token
- Defined in:
- lib/finicity/fetchers/token.rb
Class Method Summary collapse
Methods inherited from Base
Class Method Details
.get ⇒ Object
7 8 9 10 |
# File 'lib/finicity/fetchers/token.rb', line 7 def get refresh if token_expired? token end |
.refresh ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/finicity/fetchers/token.rb', line 12 def refresh response = fetch_new_one raise Finicity::TokenRefreshError, response.body unless response.success? redis["finicity-token-expires-at"] = 90.minutes.from_now.to_s redis["finicity-token"] = response.body.token end |