Class: HelpScout::TokenStorage::Redis
- Inherits:
-
Object
- Object
- HelpScout::TokenStorage::Redis
- Defined in:
- lib/help_scout/token_storage/redis.rb
Constant Summary collapse
- IDENTIFIER =
"helpscout-client-token"
Instance Method Summary collapse
-
#initialize(db) ⇒ Redis
constructor
A new instance of Redis.
- #store_token(new_token) ⇒ Object
- #token ⇒ Object
Constructor Details
#initialize(db) ⇒ Redis
Returns a new instance of Redis.
6 7 8 |
# File 'lib/help_scout/token_storage/redis.rb', line 6 def initialize(db) @db = db end |
Instance Method Details
#store_token(new_token) ⇒ Object
14 15 16 |
# File 'lib/help_scout/token_storage/redis.rb', line 14 def store_token(new_token) @db.set(IDENTIFIER, new_token) end |
#token ⇒ Object
10 11 12 |
# File 'lib/help_scout/token_storage/redis.rb', line 10 def token @db.get(IDENTIFIER) end |