lib/zhong/at.rb in zhong-0.1.6 vs lib/zhong/at.rb in zhong-0.1.7
- old
+ new
@@ -69,10 +69,14 @@
def serialize
MessagePack.pack(as_json)
end
+ def ==(other)
+ other.class == self.class && other.state == state
+ end
+
def self.parse_serialized(at)
if at.is_a?(Array)
MultiAt.new(at.map { |a| parse_serialized(a) })
else
new(minute: at["m"], hour: at["h"], wday: at["w"], grace: at["g"])
@@ -110,13 +114,9 @@
if t.nil?
"**"
else
t.to_s.rjust(2, "0")
end
- end
-
- def ==(other)
- other.class == self.class && other.state == state
end
def state
[@minute, @hour, @wday]
end