xi_wechat_corp 1.2.1 → 1.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 75a4857269dfe9e0bd116f7f3fcaa54df2ae201f
4
- data.tar.gz: 9979e3e68ebff7c71ff5206b4fdad85fa10078c9
3
+ metadata.gz: e816780236b5dc5a5fe6626e42f122339718979b
4
+ data.tar.gz: f2a650a4f354967c9e0263352525cc1b5e658363
5
5
  SHA512:
6
- metadata.gz: 40eaebeb6d7965b01b31186736b55e4436446c501a44139b2a9d6544c1261933abcf8f1e97ed0c784868dc20a430e23fbc05e126586fc55e8d023fc7c8c1bfc2
7
- data.tar.gz: b99ead191957ee7219522aa2ca8f0366930bdf2dba48e7bd2d906fc7264ca83d9e7a908313dd4d23494d83eb14ea02c95c787ec675dd3951f9a687540c68fdb9
6
+ metadata.gz: b1aa2f0f400e1cdb262519fb5c7f228ead12211ac9c78a69c7f9b0f605a853898a24d2232f61c6e61ea788be25d6949f62972a699cb9ee6e22166c1c69537bb1
7
+ data.tar.gz: 96dde77fd40f2a4405d847be95a33722bc8cfb0b212495a3b9dcb41e9f1e08c0c3b6873238c0f4b268b3be347c2622066b11a967110c30da7a81accff99f6f3e
@@ -9,7 +9,7 @@ module XiWechatCorp
9
9
  if env['xi_wechat_corp.params']
10
10
  env['xi_wechat_corp.params']
11
11
  else
12
- Grape::Parser::Xml.call(object, env)
12
+ ::Grape::Parser::Xml.call(object, env)
13
13
  end
14
14
  end
15
15
  end
@@ -19,8 +19,10 @@ module XiWechatCorp
19
19
  # formatter :xml, XiWechatCorp::Callback::Grape::Formatter
20
20
  module Formatter
21
21
  def self.call(object, env)
22
+ return object if object.is_a?(String)
23
+ return '' if object.nil?
22
24
  return object.to_xml(root: 'xml', skip_instruct: true, indent: 0) if object.respond_to?(:to_xml)
23
- fail Grape::Exceptions::InvalidFormatter.new(object.class, 'xml')
25
+ fail ::Grape::Exceptions::InvalidFormatter.new(object.class, 'xml')
24
26
  end
25
27
  end
26
28
  end
@@ -1,3 +1,3 @@
1
1
  module XiWechatCorp
2
- VERSION = '1.2.1'
2
+ VERSION = '1.2.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xi_wechat_corp
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ian Yang