Class: Wxapi

Inherits:
Object
  • Object
show all
Includes:
AccessToken, Account, Aes, Attach, Kf, Material, Menu, Misc, Qrcode, Remark, Tag, Tp, User, Utils
Defined in:
lib/wxapi/aes.rb,
lib/wxapi.rb,
lib/wxapi/tag.rb,
lib/wxapi/menu.rb,
lib/wxapi/misc.rb,
lib/wxapi/user.rb,
lib/wxapi/utils.rb,
lib/wxapi/attach.rb,
lib/wxapi/qrcode.rb,
lib/wxapi/remark.rb,
lib/wxapi/account.rb,
lib/wxapi/version.rb,
lib/wxapi/material.rb,
lib/wxapi/kf_message.rb,
lib/wxapi/access_token.rb,
lib/wxapi/templet_message.rb

Overview

微信公众号模板消息相关接口 (About templet message of wechat public) Created by zhangmingxin Date: 2018-05-17 Wechat number: zmx119966

Defined Under Namespace

Modules: AccessToken, Account, Aes, Attach, Kf, Material, Menu, Misc, Qrcode, Remark, Tag, Tp, User, Utils

Constant Summary collapse

VERSION =
"1.0.9"

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Qrcode

#unlimited_qrcode

Methods included from Misc

#api_quota, #code2session

Methods included from Remark

#remark_user

Methods included from Tag

#delete_tag, #new_tag, #tag_users, #tags, #tags_of_user, #untag_users, #update_tag, #users_of_tags

Methods included from Attach

#upload_temp_image

Methods included from User

#batch_black_list, #batch_user_detail, #batchunblacklist, #get_black_list, #get_userinfo, #user_list

Methods included from Tp

#post_template_message, #tp_delete_template, #tp_general_message, #tp_get_all, #tp_miniprogram_message

Methods included from Menu

#create_menu, #delete_menu, #query_menu

Methods included from Material

#upload_image_material, #upload_image_media

Methods included from Kf

#kf_image_message, #kf_mpnews_message, #kf_news_message, #kf_text_message, #kf_voice_message, #post_customer_message

Methods included from Aes

#decrypt, #encrypt

Methods included from Account

#get_qrscene, #get_qrsrtscene, #get_shorturl, #save_qrcode

Methods included from AccessToken

#get_access_token

Constructor Details

#initialize(options = {}) ⇒ Wxapi

Returns a new instance of Wxapi.



47
48
49
50
51
52
53
# File 'lib/wxapi.rb', line 47

def initialize(options={})
  @app_id = options[:app_id]
  @app_secret = options[:app_secret]
  @access_token_cache = options[:access_token_cache]
  @prefix = options[:prefix]
  @prefix="https://api.weixin.qq.com" if @prefix.nil?
end

Instance Attribute Details

#access_token_cacheObject

默认不缓存 access_token, access_token_cache = True 缓存

> example

wechat_api = WechatPublicApi.new appid: ‘xx’, app_secret: ‘xx’, access_token_cache: true wechat_api.app_id – get appid

api.get_access_token

Parameters:

  • aoptions (hash)


45
46
47
# File 'lib/wxapi.rb', line 45

def access_token_cache
  @access_token_cache
end

#app_idObject

默认不缓存 access_token, access_token_cache = True 缓存

> example

wechat_api = WechatPublicApi.new appid: ‘xx’, app_secret: ‘xx’, access_token_cache: true wechat_api.app_id – get appid

api.get_access_token

Parameters:

  • aoptions (hash)


45
46
47
# File 'lib/wxapi.rb', line 45

def app_id
  @app_id
end

#app_secretObject

默认不缓存 access_token, access_token_cache = True 缓存

> example

wechat_api = WechatPublicApi.new appid: ‘xx’, app_secret: ‘xx’, access_token_cache: true wechat_api.app_id – get appid

api.get_access_token

Parameters:

  • aoptions (hash)


45
46
47
# File 'lib/wxapi.rb', line 45

def app_secret
  @app_secret
end

#prefixObject

Returns the value of attribute prefix.



46
47
48
# File 'lib/wxapi.rb', line 46

def prefix
  @prefix
end