bankscrap-ing 2.0.0 → 2.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
  SHA1:
3
- metadata.gz: 1007bf78f98d871b9039be4cef30a3d021a0751b
4
- data.tar.gz: 840ee1a11e9eab6d9cf45f49c1480e7d8231eda3
3
+ metadata.gz: 0d5fccc82101d67a0d768f91ecb55f7eb529efda
4
+ data.tar.gz: d09de3829079e1f0a19cace24c988e9100b806f4
5
5
  SHA512:
6
- metadata.gz: f2671a8f84e7dba4ebaba40adfc683f716d6db192f81d0d0e1fab86cfcbde281f83ee33a1725529068ae22117295249afc6f5f332588eb6870192caf897301aa
7
- data.tar.gz: 0d7e37903319d79a66460a5808d9342587738deaea9654e65891e2be87df6799f8bcfbbb9d3beb5192bfd16a8b6c515fff8af766dcc06d4d7db164cbf3056833
6
+ metadata.gz: acde7258ac38668248a587cf1eb710414998d975b686ea48da8af444e474a8fa08eac95930e56b194851794c77a7ffec1ac3d3974c1025925bef8e1527ef0371
7
+ data.tar.gz: 9b58b605e7283d547b8e8dd91a9b9f3f26b39b6be5bab347985a335f4af64d028ba9b44f841fe7d2a06b9faa8633ce717c20f61a70c42a3ff44c18170045485a
@@ -20,6 +20,8 @@ module Bankscrap
20
20
 
21
21
  REQUIRED_CREDENTIALS = [:dni, :password, :birthday]
22
22
 
23
+ CURRENCY = Money::Currency.new("EUR")
24
+
23
25
  def initialize(credentials = {})
24
26
  super do
25
27
  @password = @password.to_s
@@ -201,8 +203,8 @@ module Bankscrap
201
203
  bank: self,
202
204
  id: data['uuid'],
203
205
  name: data['name'],
204
- balance: Money.new(data['balance'] * 100, 'EUR'),
205
- available_balance: Money.new(data['availableBalance'] * 100, 'EUR'),
206
+ balance: Money.new(data['balance'] * 100, CURRENCY),
207
+ available_balance: Money.new(data['availableBalance'] * 100, CURRENCY),
206
208
  description: (data['alias'] || data['name']),
207
209
  iban: data['iban'],
208
210
  bic: data['bic']
@@ -215,21 +217,21 @@ module Bankscrap
215
217
  id: data['uuid'],
216
218
  name: data['name'],
217
219
  balance: data['balance'],
218
- currency: 'EUR',
220
+ currency: CURRENCY.iso_code,
219
221
  investment: data['investment']
220
222
  )
221
223
  end
222
224
 
223
225
  # Build a transaction object from API data
224
226
  def build_transaction(data, account)
225
- amount = Money.new(data['amount'] * 100, data['currency'])
227
+ amount = Money.new(data['amount'] * 100, CURRENCY)
226
228
  Transaction.new(
227
229
  account: account,
228
230
  id: data['uuid'],
229
231
  amount: amount,
230
232
  effective_date: Date.strptime(data['effectiveDate'], '%d/%m/%Y'),
231
233
  description: data['description'],
232
- balance: Money.new(data['balance'] * 100, 'EUR')
234
+ balance: Money.new(data['balance'] * 100, CURRENCY)
233
235
  )
234
236
  end
235
237
  end
@@ -1,5 +1,5 @@
1
1
  module Bankscrap
2
2
  module ING
3
- VERSION = '2.0.0'.freeze
3
+ VERSION = '2.0.1'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bankscrap-ing
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Raúl
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-05 00:00:00.000000000 Z
11
+ date: 2016-10-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bankscrap
@@ -153,7 +153,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
153
153
  version: '0'
154
154
  requirements: []
155
155
  rubyforge_project:
156
- rubygems_version: 2.6.4
156
+ rubygems_version: 2.5.1
157
157
  signing_key:
158
158
  specification_version: 4
159
159
  summary: ING adapter for Bankscrap