Skip to content

Instantly share code, notes, and snippets.

@deepak
Created December 4, 2013 12:57
Show Gist options
  • Select an option

  • Save deepak/7787052 to your computer and use it in GitHub Desktop.

Select an option

Save deepak/7787052 to your computer and use it in GitHub Desktop.
membership in time range
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