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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3752ce30479e688fe642cd83397347ce22827d77
4
- data.tar.gz: ea58de569c299e6a52d031302d9f9e2ad281f329
3
+ metadata.gz: f46afd1bdc6ec135a40ad6419e1fb06ac46aeb6e
4
+ data.tar.gz: f36740280c8f0b9bb9afce147867a91172c959fe
5
5
  SHA512:
6
- metadata.gz: 97cabc388c0f9091b31f578ab68542d105e58baa626845a0d13baad708ea2419680d07382a731996609aef1acf8e48dd0ce1f9465849d5dc913361c70ffb9388
7
- data.tar.gz: fcbcff36156b663f1b5c883a8a74a94e1f56a23b9da3a9bb81f9b9334363f6957b35ed4a23b11bba6fbe34df1c630962d0d2c2f40a9fd3ff961711039af3b644
6
+ metadata.gz: d372297bc65042cb23545d98538be458bc9a6643baea5c22287d62aac3a1fc4188b5ee4b3d029f2cfbf4c28ef060f43c5029e7846d3adbf423c25346d39c062a
7
+ data.tar.gz: 7783e7970ae81bb538a9a13716f1a624a24bd46869d6fa5433b33516a9c55c49177d76a2078f55f47efbb7d23ee007f20fc52869270da782f6aeabf2fba9e054
Binary file
@@ -54,17 +54,21 @@ module Asaas
54
54
  end
55
55
 
56
56
  def parse_response
57
- res = case @response.response_code
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
 
@@ -3,7 +3,6 @@ module Asaas
3
3
  class Data < Virtus::Attribute
4
4
  def coerce(value)
5
5
  value.map do |hash|
6
- ap hash
7
6
  if hash.has_key? "object"
8
7
  entity = convert_data_to_entity(hash["object"])
9
8
  entity.new(hash)
data/lib/asaas/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Asaas
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
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.5
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