bcash-ruby 0.1.3 → 0.1.4

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: 1f8e0061d8fdb251e5eb6505f3ad22a80e4a5db2
4
- data.tar.gz: d70dedbd8cba1a5f304e9d9618a20c1810e148f3
3
+ metadata.gz: 915e0b10ef28819b90385c2e80df9c28567c7174
4
+ data.tar.gz: eea7f8c64cfbb44fc5edf0f641aeade4105ef3b1
5
5
  SHA512:
6
- metadata.gz: 987c5cd5ff478a707152f32ddf4c8b5eb75b3806c9404866032c2d36e22c30c763b54cefb64409c6e57c3e363ca1657e7cbda88a03fc5c7c8c2e8fd91e03e16b
7
- data.tar.gz: 3f2ba02f67ca23998b0f4da87f65bc96b24ef05b7387218ed0e8104b826db95e13ea4c6cf9891df67722b5993b523c982df0a94fc26023f4d826b01d4625c20b
6
+ metadata.gz: b716fa7361b1a139e514aaf504dc54046c982727996936cb049802f3d08e7a2738443e7c620b41b0a9f141b66b8d334f8924f7e767a91fc6072790e763c22ca3
7
+ data.tar.gz: 27234cdb4f7cb4710f81f2293419f1fa64cf23696200e8abfc81ec622d49d57e321a17bced039740558c0cc1671d9f12dfa7a6ca7913532dba349dd206c0602d
@@ -10,7 +10,7 @@ module Bcash::Api
10
10
 
11
11
  if data.valid?
12
12
  response = json_request :post, 'createAccount', data
13
- Bcash::Api::AccountResponse.new(response)
13
+ Bcash::Api::CreateAccountResponse.new(response)
14
14
  else
15
15
  Bcash::Api::AccountNotValidResponse.new(data)
16
16
  end
@@ -0,0 +1,7 @@
1
+ module Bcash::Api
2
+ class CreateAccountResponse < AccountResponse
3
+ def errors
4
+ body['errors']
5
+ end
6
+ end
7
+ end
@@ -24,6 +24,10 @@ module Bcash::Api
24
24
  success
25
25
  end
26
26
 
27
+ def messages
28
+ message
29
+ end
30
+
27
31
  private
28
32
 
29
33
  def parse_body(response)
@@ -33,11 +37,7 @@ module Bcash::Api
33
37
  end
34
38
 
35
39
  def value_from_errors(value)
36
- if errors.size > 1
37
- errors.collect {|e| e[value] }
38
- else
39
- errors[0][value]
40
- end
40
+ errors.collect {|e| e[value] }
41
41
  end
42
42
 
43
43
  end
data/lib/bcash/api.rb CHANGED
@@ -2,6 +2,7 @@ module Bcash::Api
2
2
  autoload :Accounts, 'bcash/api/accounts'
3
3
  autoload :Response, 'bcash/api/response'
4
4
  autoload :AccountResponse, 'bcash/api/account_response'
5
+ autoload :CreateAccountResponse, 'bcash/api/create_account_response'
5
6
  autoload :AccountNotValidResponse, 'bcash/api/account_not_valid_response'
6
7
 
7
8
  autoload :BaseRequest, 'bcash/api/request/base_request'
data/lib/bcash/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Bcash
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
@@ -57,8 +57,8 @@ describe Bcash::Api::Accounts do
57
57
  response = client.search_account_by_cpf '07800000000'
58
58
  end
59
59
 
60
- expect(response.code).to eq('202019')
61
- expect(response.message).to eq('Falha na autenticação')
60
+ expect(response.code).to eq(['202019'])
61
+ expect(response.message).to eq(['Falha na autenticação'])
62
62
  end
63
63
  end
64
64
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bcash-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Raphael Costa
@@ -187,6 +187,7 @@ files:
187
187
  - lib/bcash/api/account_not_valid_response.rb
188
188
  - lib/bcash/api/account_response.rb
189
189
  - lib/bcash/api/accounts.rb
190
+ - lib/bcash/api/create_account_response.rb
190
191
  - lib/bcash/api/request/account_creation_request.rb
191
192
  - lib/bcash/api/request/address_request.rb
192
193
  - lib/bcash/api/request/base_request.rb