A couple of notes here as I investigate further:

* Minor -- `a.is_a?(Time)` instead of `a.class == Time`
* I don't know that I totally trust `to_s` as the mechanism for comparison?  It also obscures what's actually being done -- I think it might be better to `round` then do a numeric compare.