asaas-ruby 0.1.5 → 0.1.6
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 +4 -4
- data/asaas-ruby-0.1.5.gem +0 -0
- data/lib/asaas/api/base.rb +13 -7
- data/lib/asaas/entity/meta.rb +0 -1
- data/lib/asaas/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f46afd1bdc6ec135a40ad6419e1fb06ac46aeb6e
|
4
|
+
data.tar.gz: f36740280c8f0b9bb9afce147867a91172c959fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d372297bc65042cb23545d98538be458bc9a6643baea5c22287d62aac3a1fc4188b5ee4b3d029f2cfbf4c28ef060f43c5029e7846d3adbf423c25346d39c062a
|
7
|
+
data.tar.gz: 7783e7970ae81bb538a9a13716f1a624a24bd46869d6fa5433b33516a9c55c49177d76a2078f55f47efbb7d23ee007f20fc52869270da782f6aeabf2fba9e054
|
Binary file
|
data/lib/asaas/api/base.rb
CHANGED
@@ -54,17 +54,21 @@ module Asaas
|
|
54
54
|
end
|
55
55
|
|
56
56
|
def parse_response
|
57
|
-
res =
|
57
|
+
res = @response.response_code
|
58
|
+
puts res
|
59
|
+
case @response.response_code
|
58
60
|
when 200
|
59
|
-
response_success
|
61
|
+
res = response_success
|
60
62
|
when 400
|
61
|
-
response_bad_request
|
63
|
+
res = response_bad_request
|
62
64
|
when 401
|
63
|
-
response_unauthorized
|
65
|
+
res = response_unauthorized
|
64
66
|
when 404
|
65
|
-
response_not_found
|
67
|
+
res = response_not_found
|
66
68
|
when 500
|
67
|
-
response_internal_server_error
|
69
|
+
res = response_internal_server_error
|
70
|
+
else
|
71
|
+
res = response_not_found
|
68
72
|
end
|
69
73
|
res
|
70
74
|
end
|
@@ -86,12 +90,14 @@ module Asaas
|
|
86
90
|
|
87
91
|
def response_success
|
88
92
|
hash = JSON.parse(@response.body)
|
93
|
+
|
89
94
|
if hash.fetch("object", false) === "list"
|
90
95
|
entity = Asaas::Entity::Meta.new(hash)
|
91
96
|
else
|
92
97
|
entity = convert_data_to_entity(hash.fetch("object", false))
|
93
|
-
entity.new(hash) if entity
|
98
|
+
entity = entity.new(hash) if entity
|
94
99
|
end
|
100
|
+
|
95
101
|
entity
|
96
102
|
end
|
97
103
|
|
data/lib/asaas/entity/meta.rb
CHANGED
data/lib/asaas/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: asaas-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marcos Junior
|
@@ -162,6 +162,7 @@ files:
|
|
162
162
|
- asaas-ruby-0.1.2.gem
|
163
163
|
- asaas-ruby-0.1.3.gem
|
164
164
|
- asaas-ruby-0.1.4.gem
|
165
|
+
- asaas-ruby-0.1.5.gem
|
165
166
|
- asaas-ruby.gemspec
|
166
167
|
- bin/console
|
167
168
|
- bin/setup
|