Class: WeChat::REST::Client
- Inherits:
-
Object
- Object
- WeChat::REST::Client
- Includes:
- API
- Defined in:
- lib/we_chat/rest/client.rb
Instance Attribute Summary collapse
-
#access_token ⇒ Object
Returns the value of attribute access_token.
Class Method Summary collapse
Instance Method Summary collapse
- #access_token? ⇒ Boolean
- #credentials ⇒ Hash
- #credentials? ⇒ Boolean
-
#initialize(options = {}) {|_self| ... } ⇒ Client
constructor
A new instance of Client.
Methods included from TemplateMessage
Methods included from Media
Methods included from Store
#category_get_children, #category_get_properties, #category_get_sku_definitions, #delivery_template_create, #delivery_template_delete, #delivery_template_get, #delivery_template_get_all, #delivery_template_update, #group_create, #group_delete, #group_get, #group_get_all, #group_product_update, #group_update, #order_close, #order_get, #order_get_by_filter, #order_set_delivery, #product_create, #product_delete, #product_get, #product_get_by_status, #product_modify_product_status, #product_update, #shelf_create, #shelf_delete, #shelf_get, #shelf_get_all, #shelf_update, #stock_add, #stock_reduce, #stock_update, #store_upload_image
Methods included from Menu
#menu_create, #menu_delete, #menu_get
Methods included from User
Constructor Details
#initialize(options = {}) {|_self| ... } ⇒ Client
Returns a new instance of Client.
17 18 19 20 21 22 |
# File 'lib/we_chat/rest/client.rb', line 17 def initialize( = {}) .each do |key, value| instance_variable_set("@#{key}", value) end yield(self) if block_given? end |
Instance Attribute Details
#access_token ⇒ Object
Returns the value of attribute access_token.
9 10 11 |
# File 'lib/we_chat/rest/client.rb', line 9 def access_token @access_token end |
Class Method Details
.default ⇒ Object
12 13 14 |
# File 'lib/we_chat/rest/client.rb', line 12 def default new(access_token: WeChat::AccessToken.get_access_token) end |
Instance Method Details
#access_token? ⇒ Boolean
24 25 26 |
# File 'lib/we_chat/rest/client.rb', line 24 def access_token? !!access_token end |
#credentials ⇒ Hash
29 30 31 32 33 |
# File 'lib/we_chat/rest/client.rb', line 29 def credentials { access_token: access_token, } end |
#credentials? ⇒ Boolean
36 37 38 |
# File 'lib/we_chat/rest/client.rb', line 36 def credentials? credentials.values.all? end |