natural_time 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +5 -0
- data/lib/natural_time.rb +3 -3
- data/lib/natural_time/version.rb +1 -1
- 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: dc0600ac24f45a8a17ae4a5bac6d37847b962bbd68b1abbe38cec3f5efdfa9d9
|
4
|
+
data.tar.gz: 8864817b4fa5773e718ba802146fd0a03aaabc57348a7453651957e6cdf9c93a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5b3bf330bf47e6064493fd4d3a0e2f380d93fdf245a1a7afffdd868ee770172811b8d67f5df3c109a72b40f11dc25b0cb2da0c90641db8faad55388000f5d53b
|
7
|
+
data.tar.gz: 7a9a4d434c4fc5645efa00aec11fc841ce8929816cf95a2527db3a0b153528a8db937016c80e970b5d8ecfec9594fe9b3f91c6ba5873ac3287b0045612cc73b9
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
data/lib/natural_time.rb
CHANGED
@@ -75,11 +75,11 @@ module NaturalTime
|
|
75
75
|
# @return [String]
|
76
76
|
#
|
77
77
|
# @example
|
78
|
-
# NaturalTime.
|
78
|
+
# NaturalTime.natural_time(65) #=> "1 minute, 5 seconds"
|
79
79
|
#
|
80
|
-
# NaturalTime.
|
80
|
+
# NaturalTime.natural_time(120) #=> "2 minutes"
|
81
81
|
#
|
82
|
-
# NaturalTime.
|
82
|
+
# NaturalTime.natural_time(10000) #=> "2 hours, 46 minutes, 40 seconds"
|
83
83
|
#
|
84
84
|
def natural_time(duration, precision: nil)
|
85
85
|
to_array(duration, precision: precision).join(", ")
|
data/lib/natural_time/version.rb
CHANGED