duranged 0.0.3 → 0.0.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 642f12029f91fdc00c2f2e5982ebe82fc79abd9a
4
- data.tar.gz: dd5cafa8f72224e081beb598e7e8d35c79e1b762
3
+ metadata.gz: 7c23f324a8e86d2f5e42df7cb8c50a3904c94426
4
+ data.tar.gz: f6f8d5f74d185b9df4d106b7314bfe557b03500c
5
5
  SHA512:
6
- metadata.gz: 4ec1213caf3dfd5dcb196fd7e465f3bb85aeadceef35fdef0d8b85bf8a1359324fc81a3a6caaa0710b5e45123941b9012020ef0b0d16850cdabcaded98b9b369
7
- data.tar.gz: 67856f597e86030ec143aff31312e81a9a8b1b43e2581c93dbcc3b75223c4b51b17f3f39b89ee68357fdeee5fb2917560d4f97e57275f905a7b3389f1d115eb0
6
+ metadata.gz: 3dc3189de912615bf2c52ff4b30ead77597ef018e9ca538079d9ed2560705f1fb2827ea213ff2371e535fbe12b736218ac1aaa9446341c134e080f62c20e612d
7
+ data.tar.gz: 440b452fbdcd97aa51a1b195f1c5fac6e6d6ce26e7cedabc8799de6bcfe853774bc02773b1e757c31a5984daaa09c5a1d80afc452c737a0458cb41fe1f065524
@@ -48,10 +48,18 @@ module Duranged
48
48
  self.class.new(to_i - other.to_i)
49
49
  end
50
50
 
51
+ def round_to(period=:minutes)
52
+ dup.round_to!(period)
53
+ end
54
+
51
55
  def round_to!(period=:minutes)
52
56
  send("round_to_#{period}!")
53
57
  end
54
58
 
59
+ def round_to_minutes
60
+ dup.round_to_minutes!
61
+ end
62
+
55
63
  def round_to_minutes!
56
64
  if seconds >= 30
57
65
  @value = value + (60 - seconds)
@@ -60,6 +68,10 @@ module Duranged
60
68
  end
61
69
  end
62
70
 
71
+ def round_to_hours
72
+ dup.round_to_hours!
73
+ end
74
+
63
75
  def round_to_hours!
64
76
  round_to_minutes!
65
77
  if minutes >= 30
@@ -1,3 +1,3 @@
1
1
  module Duranged
2
- VERSION = '0.0.3'
2
+ VERSION = '0.0.4'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: duranged
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Rebec