Class: HelpScout::TokenStorage::Redis

Inherits:
Object
  • Object
show all
Defined in:
lib/help_scout/token_storage/redis.rb

Constant Summary collapse

IDENTIFIER =
"helpscout-client-token"

Instance Method Summary collapse

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

#tokenObject



10
11
12
# File 'lib/help_scout/token_storage/redis.rb', line 10

def token
  @db.get(IDENTIFIER)
end