Class: Wechat::ApiBase

Inherits:
Object
  • Object
show all
Defined in:
lib/wechat/api_base.rb

Direct Known Subclasses

Api, CorpApi

Constant Summary collapse

MP_BASE =
'https://mp.weixin.qq.com/cgi-bin/'

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#access_tokenObject (readonly)

Returns the value of attribute access_token.



5
6
7
# File 'lib/wechat/api_base.rb', line 5

def access_token
  @access_token
end

#clientObject (readonly)

Returns the value of attribute client.



5
6
7
# File 'lib/wechat/api_base.rb', line 5

def client
  @client
end

Instance Method Details

#callbackipObject



9
10
11
# File 'lib/wechat/api_base.rb', line 9

def callbackip
  get 'getcallbackip'
end

#qrcode(ticket) ⇒ Object



13
14
15
# File 'lib/wechat/api_base.rb', line 13

def qrcode(ticket)
  client.get 'showqrcode', ticket: CGI.escape(ticket), base: MP_BASE, as: :file
end