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.scan(/[0-9.]/).join.to_f
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'].to_f
39
- new_account.available_balance = account['available'].to_f
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
@@ -1,3 +1,3 @@
1
1
  module Syrup
2
- VERSION = "0.0.10"
2
+ VERSION = "0.0.11"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: syrup
3
3
  version: !ruby/object:Gem::Version
4
- hash: 11
4
+ hash: 9
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 10
10
- version: 0.0.10
9
+ - 11
10
+ version: 0.0.11
11
11
  platform: ruby
12
12
  authors:
13
13
  - Don Wilson