easy_weixin 0.0.8 → 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 94a980565209207e52ac3411bb74da18a80a47f8
4
- data.tar.gz: ae9d31b93ec87c0a1c3952bb1452a8b461b4b4d2
3
+ metadata.gz: 9206ee70846db436d192ff9fb4c2764a1c48df5b
4
+ data.tar.gz: 72756ef2564b95fbe36f3015b4d712799b9d76da
5
5
  SHA512:
6
- metadata.gz: 1a7283106b8a3d21e6f7dd0b2e71bafd59b5aa7878ef0170f8576011f06e68c7c6b5bc1910cd6497c176a9cbd21cf10b6d91ddae7709123f4be7bcecc748a61d
7
- data.tar.gz: 0386efbb68f60d9747fe4a41100551fb0929a99aa779d9d1ae668fca63d87d2006285074d81c8fc2560ade9558907ead412e408eaba1e23f5f590334b89b6f77
6
+ metadata.gz: 4d10ecaca75544322f6de133d2a891386bde6a73ad519c6893b5be721df2692051e7d77d0e352f484e00e7faaa17663c25123c7a429673fdaeb914d13fd422f0
7
+ data.tar.gz: 6d52b70b5ddde6433d2c240126731f000996254f174b5290655fa911ab70c3fd04f88b5f4d386211fd7364c7e6fd21eb5107737a0b39c1a6a2fd384bbd61a5a3
data/lib/easy_weixin.rb CHANGED
@@ -6,7 +6,7 @@ require 'rack'
6
6
  require 'open-uri'
7
7
 
8
8
  module EasyWeixin
9
- extend self
9
+ extend self
10
10
 
11
11
  def text_msg(from, to, content)
12
12
  msg = TextReplyMessage.new
@@ -16,10 +16,13 @@ module EasyWeixin
16
16
  msg.to_xml
17
17
  end
18
18
 
19
- def news_msg(from, to, articles, articleCount)
19
+ def news_msg(from, to, articles, articleCount=1)
20
20
  msg = NewsReplyMessage.new
21
21
  msg.ToUserName = to
22
22
  msg.FromUserName = from
23
+ unless articles.is_a?(Array)
24
+ articles = [articles]
25
+ end
23
26
  msg.Articles = articles
24
27
  msg.ArticleCount = articleCount
25
28
  msg.to_xml
@@ -1,3 +1,3 @@
1
1
  module EasyWeixin
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easy_weixin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - menghuanwd
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-21 00:00:00.000000000 Z
11
+ date: 2015-03-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler