class Dingtalk::Token::RedisStore
Public Instance Methods
access_token()
click to toggle source
Calls superclass method
# File lib/dingtalk/token/redis_store.rb, line 24 def access_token super client.access_token = redis.hget(client.redis_key, "access_token") client.expired_at = redis.hget(client.redis_key, "expired_at") client.access_token end
redis()
click to toggle source
# File lib/dingtalk/token/redis_store.rb, line 31 def redis Dingtalk.redis end
refresh_token()
click to toggle source
Calls superclass method
# File lib/dingtalk/token/redis_store.rb, line 14 def refresh_token super redis.hmset( client.redis_key, "access_token", client.access_token, "expired_at", client.expired_at ) redis.expireat(client.redis_key, client.expired_at.to_i) end
token_expired?()
click to toggle source
# File lib/dingtalk/token/redis_store.rb, line 10 def token_expired? redis.hvals(client.redis_key).empty? end
valid?()
click to toggle source
Calls superclass method
# File lib/dingtalk/token/redis_store.rb, line 5 def valid? redis.del(client.redis_key) super end