class Youzanyun::Token::RedisStore
Public Instance Methods
access_token()
click to toggle source
Calls superclass method
# File lib/youzanyun/token/redis_store.rb, line 28 def access_token super client.access_token = youzanyun_redis.hget(client.redis_key, "access_token") client.expired_at = youzanyun_redis.hget(client.redis_key, "expired_at") client.token_type = youzanyun_redis.hget(client.redis_key, "token_type") client.access_token end
refresh_token()
click to toggle source
Calls superclass method
# File lib/youzanyun/token/redis_store.rb, line 17 def refresh_token super youzanyun_redis.hmset( client.redis_key, "access_token", client.access_token, "expired_at", client.expired_at, "token_type", client.token_type ) youzanyun_redis.expireat(client.redis_key, client.expired_at.to_i) end
token_expired?()
click to toggle source
# File lib/youzanyun/token/redis_store.rb, line 13 def token_expired? youzanyun_redis.hvals(client.redis_key).empty? end
valid?()
click to toggle source
Calls superclass method
# File lib/youzanyun/token/redis_store.rb, line 8 def valid? youzanyun_redis.del(client.redis_key) super end
youzanyun_redis()
click to toggle source
# File lib/youzanyun/token/redis_store.rb, line 36 def youzanyun_redis Youzanyun.youzanyun_redis end