Class: WechatGate::Tokens::AccessToken::Get

Inherits:
Base
  • Object
show all
Defined in:
lib/wechat_gate/tokens/access_token.rb

Instance Method Summary collapse

Methods inherited from Base

#expired_in, #initialize, refresh, #run

Constructor Details

This class inherits a constructor from WechatGate::Tokens::Base

Instance Method Details

#save(response) ⇒ Object



21
22
23
24
25
# File 'lib/wechat_gate/tokens/access_token.rb', line 21

def save response
  File.open(saved_file, 'w') do |f|
    f.puts "#{Time.now.to_i} #{response['access_token']}"
  end
end

#urlObject



17
18
19
# File 'lib/wechat_gate/tokens/access_token.rb', line 17

def url
  "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=#{@config.config['app_id']}&secret=#{@config.config['app_secret']}"
end