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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cea1c7188cb9f0611e98f27122b16c6ff12f6760
4
- data.tar.gz: b56617dd53c3067e44f381425b013b0846eca94e
3
+ metadata.gz: d6d59089afee4e7b6707106985fec8329574032f
4
+ data.tar.gz: 863897d8ba5bbd96ab917b664d07777a19243275
5
5
  SHA512:
6
- metadata.gz: af3f37cbcca2633b648555e811751399814587e160593cdb5d2af903c42ff8608491871f7e100f45e9557a1a54ec286bbf2d4a212de6278b7d2d238358c11f2d
7
- data.tar.gz: '08cf5c1f2c891b06c870c1a8c7baecaa1c2ebe795e51a0b4ebc488c93c94634025cb53c47d61e7da384777e990fd3e24708c2762ee2e1d7a174595e5ecab3d60'
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] = DateTime.parse(response[:start_date])
21
- response[:end_date] = DateTime.parse(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
@@ -1,3 +1,3 @@
1
1
  module RockRMS
2
- VERSION = '3.4.0'.freeze
2
+ VERSION = '3.4.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rock_rms
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.4.0
4
+ version: 3.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Taylor Brooks