camt_parser 2.6.0 → 2.6.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
  SHA256:
3
- metadata.gz: 05b24b4adaf5da71f1a1043116340f85f9aad5928ca88db73864d6950511b358
4
- data.tar.gz: 5a807a27c6e9918c44b352b96235efc3146381cba183a04cb0878de7d3c0854c
3
+ metadata.gz: 00f3fb73d05c7b0d0d93000532bde43634aad5932caa3f10ea86bb6c1e5a9bc8
4
+ data.tar.gz: f15a89c2d22cf875a2fd022f13fec15f1ef1062451e9bdeab6fb857c9e436257
5
5
  SHA512:
6
- metadata.gz: 4eadb807816140108c6c1fe1731e2473bbc59b7c9dc3c131759fd51b93e048f3a9f50fc5feaef4ee5b5884dc56259be2daa85c68b9dd1072e8ecd9f6a2c14695
7
- data.tar.gz: 60acaaf6ed7b13301f302168d09df3488dd66e6dbd7c4802a7bda73732365c4be4442409e390e70d0efc9b9085aafee2335ef9acfd4d7c4be7645d4d7fb4e93a
6
+ metadata.gz: 6dbea0f97b710bc39a66f50eb8fcc3b64ba735d4b2f7be99045c84ffec9dfc71afa2b2919c392d4b09fb597220051acd2131c8c2e654f91c3d39706f5dccca9f
7
+ data.tar.gz: cace1184fac77e96c0669d810154a9188f4da3631a72d7c67b0de99bbaf787fdb34f34ea0e0f80bf00590c1a39253728cfdd1e846398a57512ac919a7cb2bb38
@@ -108,7 +108,7 @@ module CamtParser
108
108
  private
109
109
 
110
110
  def parse_amount
111
- @amount = if @xml_data.xpath('Amt').any?
111
+ if @xml_data.xpath('Amt').any?
112
112
  @xml_data.xpath('Amt/text()').text
113
113
  elsif @xml_data.xpath('AmtDtls').any?
114
114
  @xml_data.xpath('AmtDtls/TxAmt/Amt/text()').text
@@ -118,7 +118,7 @@ module CamtParser
118
118
  end
119
119
 
120
120
  def parse_currency
121
- @currenty = if @xml_data.xpath('Amt').any?
121
+ if @xml_data.xpath('Amt').any?
122
122
  @xml_data.xpath('Amt/@Ccy').text
123
123
  elsif @xml_data.xpath('AmtDtls').any?
124
124
  @xml_data.xpath('AmtDtls/TxAmt/Amt/@Ccy').text
@@ -2,11 +2,15 @@ module CamtParser
2
2
  class Misc
3
3
  class << self
4
4
  def to_amount_in_cents(value)
5
+ return nil if value == nil || value.strip == ''
6
+
5
7
  value.gsub(/[,|\.](\d*)/) { $1.ljust(2, '0') }.to_i
6
8
  end
7
9
 
8
10
  def to_amount(value)
9
- BigDecimal value.gsub(',', '.')
11
+ return nil if value == nil || value.strip == ''
12
+
13
+ BigDecimal(value.gsub(',', '.'))
10
14
  end
11
15
  end
12
16
  end
@@ -1,3 +1,3 @@
1
1
  module CamtParser
2
- VERSION = "2.6.0"
2
+ VERSION = "2.6.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: camt_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.0
4
+ version: 2.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Schoknecht
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-04-18 00:00:00.000000000 Z
11
+ date: 2019-05-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake