Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

About your question, the reason is that `===` is aliased to `Range#include?` which checks if the argument is a discrete element contained in the range.

That range of `Date`s does not include any `DateTime`s, so the inclusion check returns false.

`Range#cover?` on the other hand, just uses >= and <= to check .



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: