usps-imis-api 0.13.0 → 0.13.1
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
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4f2a87078ddd79a70812f9d8047a10b431300ce84bdc4d6304458001ec0f525c
|
|
4
|
+
data.tar.gz: 475666c51fc44ac9473dc7ceeab05758f1fbdf314554140851b8f04d5775ceeb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1d862618ef81096dac1c2b026228956d27c4b600b914a8f48dd403508e8b9a43c337ab9414c711390af71e1b1fb686cfda81cd1164c8ad5aaa244c4836139928
|
|
7
|
+
data.tar.gz: 86aff154476bccb2cc88cf8f8f149a12166ea3c03123139e42141a8de97b42a4d9ee7e7ee1f3f0bee555c588cd08c60d9bdb476a09636508489ac6bc849c347b
|
|
@@ -51,10 +51,18 @@ module Usps
|
|
|
51
51
|
# :nocov:
|
|
52
52
|
|
|
53
53
|
def format_output(value)
|
|
54
|
-
if value.is_a?(Array)
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
if value.is_a?(Array)
|
|
55
|
+
case @options
|
|
56
|
+
in csv: true then return csv(value)
|
|
57
|
+
in jsonl: true then return jsonl(value)
|
|
58
|
+
else return json(value)
|
|
59
|
+
end
|
|
57
60
|
end
|
|
61
|
+
|
|
62
|
+
return json(value) if @options[:json]
|
|
63
|
+
return value if value.is_a?(String) || value.is_a?(Symbol) || value.nil?
|
|
64
|
+
|
|
65
|
+
json(value)
|
|
58
66
|
end
|
|
59
67
|
|
|
60
68
|
def json(value) = JSON.dump(value)
|
|
@@ -114,12 +114,15 @@ Options:
|
|
|
114
114
|
raw:
|
|
115
115
|
- Return raw JSON output, rather than simplified data
|
|
116
116
|
- short: R
|
|
117
|
-
jsonl:
|
|
118
|
-
- Format array output as JSONL
|
|
119
|
-
- short: j
|
|
120
117
|
csv:
|
|
121
118
|
- Format output as CSV (if possible)
|
|
122
119
|
- short: S
|
|
120
|
+
jsonl:
|
|
121
|
+
- Format array output as JSONL
|
|
122
|
+
- short: j
|
|
123
|
+
json:
|
|
124
|
+
- Format string output also as JSON (i.e. quoted)
|
|
125
|
+
- short: J
|
|
123
126
|
|
|
124
127
|
Configuration:
|
|
125
128
|
config:
|
data/lib/usps/imis/version.rb
CHANGED