class WeixinAuthorize::Token::RedisStore
Public Instance Methods
access_token()
click to toggle source
Calls superclass method
# File lib/weixin_authorize/token/redis_store.rb, line 25 def access_token super client.access_token = weixin_redis.hget(client.redis_key, "access_token") client.expired_at = weixin_redis.hget(client.redis_key, "expired_at") client.access_token end
refresh_token()
click to toggle source
Calls superclass method
# File lib/weixin_authorize/token/redis_store.rb, line 15 def refresh_token super weixin_redis.hmset( client.redis_key, "access_token", client.access_token, "expired_at", client.expired_at ) weixin_redis.expireat(client.redis_key, client.expired_at.to_i) end
token_expired?()
click to toggle source
# File lib/weixin_authorize/token/redis_store.rb, line 11 def token_expired? weixin_redis.hvals(client.redis_key).empty? end
valid?()
click to toggle source
Calls superclass method
# File lib/weixin_authorize/token/redis_store.rb, line 6 def valid? weixin_redis.del(client.redis_key) super end
weixin_redis()
click to toggle source
# File lib/weixin_authorize/token/redis_store.rb, line 32 def weixin_redis WeixinAuthorize.weixin_redis end