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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YTYzMGFjNjA2NTg2MjdiNzJlZjZlMDZkYzQ3OWQyMGFhZDE3ZmY4Mw==
4
+ NzA4ZGJiMDI3M2FlMDk3MTY2Zjc0YTZlYzczZjM5NGZiZWRkNTRhZA==
5
5
  data.tar.gz: !binary |-
6
- M2FkY2E0OWRmOTFiNWJiMjk3OWI5OWZhMzFhMTRmNWJkM2EyYmY1Ng==
6
+ NzM2MTEyNmYzMDZhNzE1ZTExOTlmN2Q0NGFjN2YzN2JkMDVlZjFiYg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YzM1Y2U3NThjODc3ZDcwOGU3YzRlNWQxNjk2MmY4YThmYzBmNGE4ZmMzY2M0
10
- YjI2ZTNlODM1MzAwZWI0NDcyNDBjNWJiMzUwNGY3YjU2NDg2YTBkOGQwODRl
11
- Mjg0MDE1MjczNTQxY2E5MzViMTkxYzhkMDdhYzk5ODhiOTNlMmY=
9
+ ZTBlOWVhODZmZDkzYzhiNDU1Y2I1MzMwZDM4NjVjOThkNzY3YTVjMDljMjVi
10
+ YjQ2ODg3NGFlNjkwMjA2ZjlmNWM2YTc3Mjc0YzU4MmQxZTg3ZTA0ZmI5MWI4
11
+ ODcwNTQ5OWY2NDRkOGI2NzY3OTA3NWFmYTE4NmJiNGNjOTI5YzU=
12
12
  data.tar.gz: !binary |-
13
- MjYzZmRkOGMwMmZhNzliYTM2MjdmNWVjNzhmYzc2YjZkNjBiZjBlNzRlOGVk
14
- MTdkZjMxYWQ1NWRiNWIzOTFiZDQwMDhmZTNiZGRjNmIwMjU0MjI5N2U2NWI4
15
- ZmViZjhmYzViOWE5YjkyODEzNzdiMjY1YmVlNTQ4OTIzNWIzYzM=
13
+ MmM1YmI4OTdlMzgwMmFkYjAwNzAwNDNiMzI1Y2E1ZDEzMThjMjM5NzkwN2Q4
14
+ MWJiMDQ5MjkwMDg1YWM0ZmYyNTYwY2M5YmQ3MzdmODQ3NzdkOTcyZWRjMzkz
15
+ Mjg2N2NhMGUzNWQzNGJlNzE1Njk3ZGQyNDRkYzcxNzdiYWZhZjk=
data/figo.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "figo"
3
- s.version = "1.2.1"
3
+ s.version = "1.2.3"
4
4
  s.authors = ["Stefan Richter"]
5
5
  s.email = ["stefan.richter@figo.me"]
6
6
  s.homepage = "https://github.com/figo-connect/ruby-figo"
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
- balance = @sut.get_account("A1.2").balance
42
- assert balance.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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: figo
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Richter