camt_parser 2.6.0 → 2.6.1
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 +4 -4
- data/lib/camt_parser/general/transaction.rb +2 -2
- data/lib/camt_parser/misc.rb +5 -1
- data/lib/camt_parser/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 00f3fb73d05c7b0d0d93000532bde43634aad5932caa3f10ea86bb6c1e5a9bc8
|
4
|
+
data.tar.gz: f15a89c2d22cf875a2fd022f13fec15f1ef1062451e9bdeab6fb857c9e436257
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
-
|
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
|
data/lib/camt_parser/misc.rb
CHANGED
@@ -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
|
-
|
11
|
+
return nil if value == nil || value.strip == ''
|
12
|
+
|
13
|
+
BigDecimal(value.gsub(',', '.'))
|
10
14
|
end
|
11
15
|
end
|
12
16
|
end
|
data/lib/camt_parser/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2019-05-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|