rock_rms 3.4.0 → 3.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rock_rms/response/batch.rb +10 -2
- data/lib/rock_rms/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d6d59089afee4e7b6707106985fec8329574032f
|
4
|
+
data.tar.gz: 863897d8ba5bbd96ab917b664d07777a19243275
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fa7e6054abde31dd865dc0d03d33fedd77f5be7d82ec30e6141537e9965eb0c83540b4f5022ac09ab265a9c163ae09dd8e0bd69c15708d98254f5957e2bf8814
|
7
|
+
data.tar.gz: 5fc9d8d7b84136e763147fc3a97ea26b9b91054ef834702bf32808984e9b29cbaa2b4441969ac0559b8311fae26a474867e67c7eea57ba3998bcd65a5848df72
|
@@ -17,14 +17,22 @@ module RockRMS
|
|
17
17
|
response = to_h(MAP, data)
|
18
18
|
response[:transactions] = Transaction.format(response[:transactions])
|
19
19
|
response[:amount] = calculate_total(response[:transactions])
|
20
|
-
response[:start_date] =
|
21
|
-
response[:end_date] =
|
20
|
+
response[:start_date] = date_parse(response[:start_date])
|
21
|
+
response[:end_date] = date_parse(response[:end_date])
|
22
22
|
response
|
23
23
|
end
|
24
24
|
|
25
25
|
def calculate_total(transactions)
|
26
26
|
transactions.reduce(0) { |sum, txn| sum + txn[:amount] }
|
27
27
|
end
|
28
|
+
|
29
|
+
def date_parse(string)
|
30
|
+
if string
|
31
|
+
DateTime.parse(string)
|
32
|
+
else
|
33
|
+
nil
|
34
|
+
end
|
35
|
+
end
|
28
36
|
end
|
29
37
|
end
|
30
38
|
end
|
data/lib/rock_rms/version.rb
CHANGED