lib/time_distribution/time.rb in time_distribution-0.0.1 vs lib/time_distribution/time.rb in time_distribution-1.0.0
- old
+ new
@@ -1,11 +1,15 @@
require 'chronic'
-class Time
- def count_forward_to(time)
- if self > time
- (Chronic.parse('11:59:59pm') - self) + (time - Chronic.parse('12:00:00am')) + 1
- else
- time - self
+module TimeDistribution
+ module TimeRefinement
+ refine Time do
+ def count_forward_to(time)
+ if self > time
+ (Chronic.parse('11:59:59pm') - self) + (time - Chronic.parse('12:00:00am')) + 1
+ else
+ time - self
+ end
+ end
end
end
-end
\ No newline at end of file
+end