syrup 0.0.10 → 0.0.11
Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'bigdecimal'
|
2
|
+
|
1
3
|
module Syrup
|
2
4
|
module Institutions
|
3
5
|
class InstitutionBase
|
@@ -149,7 +151,7 @@ module Syrup
|
|
149
151
|
#
|
150
152
|
# parse_currency('$ 1,234.56') #=> 1234.56
|
151
153
|
def parse_currency(currency)
|
152
|
-
currency.
|
154
|
+
BigDecimal.new(currency.gsub(/[^0-9.]/, ''))
|
153
155
|
end
|
154
156
|
|
155
157
|
# A helper method that replaces a few HTML entities with their actual characters
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'date'
|
2
|
+
require 'bigdecimal'
|
2
3
|
|
3
4
|
module Syrup
|
4
5
|
module Institutions
|
@@ -35,8 +36,8 @@ module Syrup
|
|
35
36
|
new_account = Account.new(:id => account['accountIndex'], :institution => self)
|
36
37
|
new_account.name = unescape_html(account['displayName'][/^[^(]*/, 0].strip)
|
37
38
|
new_account.account_number = account['displayName'][/\(([*0-9-]+)\)/, 1]
|
38
|
-
new_account.current_balance = account['current']
|
39
|
-
new_account.available_balance = account['available']
|
39
|
+
new_account.current_balance = BigDecimal.new(account['current'])
|
40
|
+
new_account.available_balance = BigDecimal.new(account['available'])
|
40
41
|
# new_account.type = :deposit # :credit
|
41
42
|
|
42
43
|
accounts << new_account
|
@@ -133,4 +134,4 @@ module Syrup
|
|
133
134
|
|
134
135
|
end
|
135
136
|
end
|
136
|
-
end
|
137
|
+
end
|
data/lib/syrup/version.rb
CHANGED
metadata
CHANGED