lib/chronic/repeaters/repeater_minute.rb in chronic-0.9.1 vs lib/chronic/repeaters/repeater_minute.rb in chronic-0.10.0
- old
+ new
@@ -1,17 +1,18 @@
module Chronic
class RepeaterMinute < Repeater #:nodoc:
MINUTE_SECONDS = 60
- def initialize(type)
+ def initialize(type, options = {})
super
+ @current_minute_start = nil
end
def next(pointer = :future)
super
- if !@current_minute_start
+ unless @current_minute_start
case pointer
when :future
@current_minute_start = Chronic.construct(@now.year, @now.month, @now.day, @now.hour, @now.min + 1)
when :past
@current_minute_start = Chronic.construct(@now.year, @now.month, @now.day, @now.hour, @now.min - 1)
@@ -53,6 +54,6 @@
def to_s
super << '-minute'
end
end
-end
\ No newline at end of file
+end