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 +4 -4
- data/lib/xi_wechat_corp/callback/grape.rb +4 -2
- data/lib/xi_wechat_corp/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e816780236b5dc5a5fe6626e42f122339718979b
|
4
|
+
data.tar.gz: f2a650a4f354967c9e0263352525cc1b5e658363
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|