birthday_calculator 0.0.1 → 0.0.2
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/birthday_calculator.rb +3 -2
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 773901be5cf1fca6cc4c74d2a9f7a3cde857c7146b3771bbfad3471f41a34114
|
|
4
|
+
data.tar.gz: cce4229b3e29e6e8ab0cf8c04c7c652bd42e59ef76a17d91100dbb541373e46a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: cee69c97ed690ee1c91bcf0533b2d0c223e9213d30cc3d7357462830c7ce4f143319fcd8b21d36255c2c48933010af739d1bd47d797df02b6dd91959e12657d4
|
|
7
|
+
data.tar.gz: 10b06f61019908c66c34de1320ad4efe5d090599f0d79f521f787d3a8b612467435e07ac4719496532c6ea1206b10e04478a54f24e39d5f98280b60fae62563e
|
data/lib/birthday_calculator.rb
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
require 'time'
|
|
2
2
|
require 'date'
|
|
3
|
+
require 'ostruct'
|
|
3
4
|
require 'active_support/all'
|
|
4
5
|
|
|
5
6
|
class BirthdayCalculator
|
|
@@ -40,8 +41,7 @@ class BirthdayCalculator
|
|
|
40
41
|
hh, mm = mm.divmod(60)
|
|
41
42
|
dd, hh = hh.divmod(24)
|
|
42
43
|
|
|
43
|
-
|
|
44
|
-
return "It's left #{dd} days, #{hh} hours and #{mm} minutes to your birthday!"
|
|
44
|
+
OpenStruct.new(days: dd, hours: hh, minutes: mm)
|
|
45
45
|
end
|
|
46
46
|
|
|
47
47
|
def modify_date(year, month, day, hour, min, sec)
|
|
@@ -58,3 +58,4 @@ class BirthdayCalculator
|
|
|
58
58
|
end
|
|
59
59
|
end
|
|
60
60
|
end
|
|
61
|
+
|