Created
December 4, 2013 12:57
-
-
Save deepak/7787052 to your computer and use it in GitHub Desktop.
membership in time range
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| now = Time.now # => 2013-12-04 18:24:36 +0530 | |
| future = Time.now + 2.hours # => 2013-12-04 20:24:57 +0530 | |
| (now..future).member? now | |
| # TypeError: can't iterate from Time | |
| # from /usr/local/opt/rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/activesupport-4.0.1/lib/active_support/core_ext/range/each.rb:21:in `ensure_iteration_allowed' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment