figo 1.2.1 → 1.2.3
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 +8 -8
- data/figo.gemspec +1 -1
- data/lib/models.rb +7 -8
- data/test/test_figo.rb +2 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NzA4ZGJiMDI3M2FlMDk3MTY2Zjc0YTZlYzczZjM5NGZiZWRkNTRhZA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NzM2MTEyNmYzMDZhNzE1ZTExOTlmN2Q0NGFjN2YzN2JkMDVlZjFiYg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZTBlOWVhODZmZDkzYzhiNDU1Y2I1MzMwZDM4NjVjOThkNzY3YTVjMDljMjVi
|
10
|
+
YjQ2ODg3NGFlNjkwMjA2ZjlmNWM2YTc3Mjc0YzU4MmQxZTg3ZTA0ZmI5MWI4
|
11
|
+
ODcwNTQ5OWY2NDRkOGI2NzY3OTA3NWFmYTE4NmJiNGNjOTI5YzU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MmM1YmI4OTdlMzgwMmFkYjAwNzAwNDNiMzI1Y2E1ZDEzMThjMjM5NzkwN2Q4
|
14
|
+
MWJiMDQ5MjkwMDg1YWM0ZmYyNTYwY2M5YmQ3MzdmODQ3NzdkOTcyZWRjMzkz
|
15
|
+
Mjg2N2NhMGUzNWQzNGJlNzE1Njk3ZGQyNDRkYzcxNzdiYWZhZjk=
|
data/figo.gemspec
CHANGED
data/lib/models.rb
CHANGED
@@ -48,8 +48,10 @@ module Figo
|
|
48
48
|
next unless respond_to? "#{key}="
|
49
49
|
next if value.nil?
|
50
50
|
|
51
|
-
if key == "status"
|
51
|
+
if key == "status" and value.is_a? Hash
|
52
52
|
value = SynchronizationStatus.new(session, value)
|
53
|
+
elsif key == "balance" and value.is_a? Hash
|
54
|
+
value = AccountBalance.new(session, value)
|
53
55
|
elsif key == "amount" or key == "balance" or key == "credit_line" or key == "monthly_spending_limit"
|
54
56
|
value = Flt::DecNum(value.to_s)
|
55
57
|
elsif key.end_with?("_date")
|
@@ -192,6 +194,10 @@ module Figo
|
|
192
194
|
# @return [SynchronizationStatus]
|
193
195
|
attr_accessor :status
|
194
196
|
|
197
|
+
# AccountBalance object
|
198
|
+
# @return [AccountBalance]
|
199
|
+
attr_accessor :balance
|
200
|
+
|
195
201
|
# Request list of transactions of this account
|
196
202
|
#
|
197
203
|
# @param since [String, Date] this parameter can either be a transaction ID or a date
|
@@ -234,13 +240,6 @@ module Figo
|
|
234
240
|
def bank
|
235
241
|
@session.get_bank @bank_id
|
236
242
|
end
|
237
|
-
|
238
|
-
# Retrieve balance of this account
|
239
|
-
#
|
240
|
-
# @return [AccountBalance] `AccountBalance` of this account
|
241
|
-
def balance
|
242
|
-
@session.get_account_balance @account_id
|
243
|
-
end
|
244
243
|
end
|
245
244
|
|
246
245
|
# Object representing the balance of a certain bank account of the User
|
data/test/test_figo.rb
CHANGED
@@ -38,9 +38,8 @@ class FigoTest < MiniTest::Unit::TestCase
|
|
38
38
|
assert_equal account.account_id, "A1.2"
|
39
39
|
|
40
40
|
# account sub-resources
|
41
|
-
|
42
|
-
assert balance.
|
43
|
-
assert balance.balance_date
|
41
|
+
assert @sut.get_account("A1.2").balance.balance
|
42
|
+
assert @sut.get_account("A1.2").balance.balance_date
|
44
43
|
|
45
44
|
transactions = @sut.get_account("A1.2").transactions
|
46
45
|
assert transactions.length > 0
|