Class: WeixinAuthorize::JsTicket::ObjectStore

Inherits:
Store
  • Object
show all
Defined in:
lib/weixin_authorize/js_ticket/object_store.rb

Instance Attribute Summary

Attributes inherited from Store

#client

Instance Method Summary collapse

Methods inherited from Store

init_with, #initialize, #set_jsticket

Constructor Details

This class inherits a constructor from WeixinAuthorize::JsTicket::Store

Instance Method Details

#jsticketObject



10
11
12
13
# File 'lib/weixin_authorize/js_ticket/object_store.rb', line 10

def jsticket
  super
  client.jsticket
end

#jsticket_expired?Boolean

Returns:

  • (Boolean)


5
6
7
8
# File 'lib/weixin_authorize/js_ticket/object_store.rb', line 5

def jsticket_expired?
  # 如果当前token过期时间小于现在的时间,则重新获取一次
  client.jsticket_expired_at <= Time.now.to_i
end

#refresh_jsticketObject



15
16
17
# File 'lib/weixin_authorize/js_ticket/object_store.rb', line 15

def refresh_jsticket
  super
end