belvo 0.20.0 → 1.0.1

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
  SHA256:
3
- metadata.gz: 05a03ab57113f17e822b4f48dd813edf5206bacfb79a757332fce693a60db786
4
- data.tar.gz: 2676ef16eabab4fcbd553ec28cf7378539eb468387954a2754b62d1c6642fe6e
3
+ metadata.gz: b8ddc3b560df375b13cdfba4173c362979192231a40cc3c248bd3436f6c19790
4
+ data.tar.gz: a8a03709a98a0b0a1d59f57255a45e14631684199b1ebf1c5844d56da66b3860
5
5
  SHA512:
6
- metadata.gz: 522bc53deacef6bc63010a44d837acc100560bd9cb5a3721eea94cde3b37abb3090c385c9c0c2d411ebfd39fe9c1c88fc905ba03dc6bf70cb2ed58899af0f1c8
7
- data.tar.gz: 4bcee96d178f49fc23bac577725560f279f21e8a96670694b5d0f2918871e0ea5e332ba09b421769e24740217402e45c55f6e2bdfaaeda0c04caba00d0d92411
6
+ metadata.gz: 21f0eff9a499c6d7de8aa2b730224853eee43abdc91ac2e8a1cd3e700e3238f6c969f5fa75f3b129405d437123c65e2dd1ffac9bcabad01f6140790adbd67d58
7
+ data.tar.gz: 8aa63d37ed8b551b83483b0cd1ca08f9c72b477ee45781ad6a0baceb81c1be03adb689aa1fbc1105e299ead79f8b814e6d5676753fcf26deae2efc8563ed8299
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- belvo (0.20.0)
4
+ belvo (1.0.1)
5
5
  faraday
6
6
  faraday_middleware
7
7
  typhoeus
data/README.md CHANGED
@@ -53,7 +53,9 @@ begin
53
53
 
54
54
  belvo.accounts.retrieve(link: link_id)
55
55
 
56
- puts belvo.accounts.list
56
+ belvo.accounts.list.each do |item|
57
+ puts item
58
+ end
57
59
  rescue Belvo::RequestError => e
58
60
  puts e.status_code
59
61
  puts e.detail
@@ -83,7 +85,9 @@ begin
83
85
 
84
86
  belvo.accounts.retrieve(link: new_link['id'])
85
87
 
86
- puts belvo.accounts.list
88
+ belvo.accounts.list.each do |item|
89
+ puts item
90
+ end
87
91
  rescue Belvo::RequestError => e
88
92
  puts e.status_code
89
93
  puts e.detail
data/lib/belvo/http.rb CHANGED
@@ -91,16 +91,8 @@ module Belvo
91
91
  # @raise [RequestError] If response code is different than 2XX
92
92
  def list(path, params: nil)
93
93
  params = {} if params.nil?
94
- loop do
95
- response = get(path, params: params)
96
- response.body['results'].each do |item|
97
- yield item if block_given?
98
- end
99
-
100
- break unless response.body['next']
101
-
102
- params = Faraday::Utils.parse_query URI(response.body['next']).query
103
- end
94
+ response = get(path, params: params)
95
+ response.body['results']
104
96
  end
105
97
 
106
98
  # Show specific resource details
@@ -29,11 +29,7 @@ module Belvo
29
29
  # @yield [Hash] Each result to be processed individually.
30
30
  # @raise [RequestError] If response code is different than 2XX
31
31
  def list(params: nil)
32
- results = block_given? ? nil : []
33
- @session.list(@endpoint, params: params) do |item|
34
- results.nil? ? yield(item) : results.push(item)
35
- end
36
- results
32
+ @session.list(@endpoint, params: params)
37
33
  end
38
34
 
39
35
  # Show specific resource details
data/lib/belvo/version.rb CHANGED
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Belvo
4
4
  # belvo-ruby current version
5
- VERSION = '0.20.0'
5
+ VERSION = '1.0.1'
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: belvo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.20.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Belvo Finance S.L.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-05-06 00:00:00.000000000 Z
11
+ date: 2022-05-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday