lib/clockwork/at.rb in clockwork-0.7.7 vs lib/clockwork/at.rb in clockwork-1.0.0
- old
+ new
@@ -31,11 +31,11 @@
end
rescue ArgumentError
raise FailedToParse, at
end
- attr_writer :min, :hour, :wday
+ attr_accessor :min, :hour, :wday
def initialize(min, hour=NOT_SPECIFIED, wday=NOT_SPECIFIED)
@min = min
@hour = hour
@wday = wday
@@ -44,9 +44,13 @@
def ready?(t)
(@min == NOT_SPECIFIED or t.min == @min) and
(@hour == NOT_SPECIFIED or t.hour == @hour) and
(@wday == NOT_SPECIFIED or t.wday == @wday)
+ end
+
+ def == other
+ @min == other.min && @hour == other.hour && @wday == other.wday
end
private
def valid?
@min == NOT_SPECIFIED || (0..59).cover?(@min) &&