diff options
Diffstat (limited to 'railties')
-rw-r--r-- | railties/guides/source/active_support_core_extensions.textile | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/railties/guides/source/active_support_core_extensions.textile b/railties/guides/source/active_support_core_extensions.textile index 7155cb9a79..2df46a332f 100644 --- a/railties/guides/source/active_support_core_extensions.textile +++ b/railties/guides/source/active_support_core_extensions.textile @@ -1668,6 +1668,16 @@ Active Support extends this method so that the argument may be another range in WARNING: The orginal +Range#include?+ is still the one aliased to +Range#===+. +h4. +overlaps?+ + +The method +Range#overlaps?+ says whether any two given ranges have non-void intersection: + +<ruby> +(1..10).overlaps?(7..11) # => true +(1..10).overlaps?(0..7) # => true +(1..10).overlaps?(11..27) # => false +</ruby> + h3. Extensions to +Proc+ ... |