aboutsummaryrefslogtreecommitdiffstats
path: root/railties/guides/source/active_support_core_extensions.textile
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2009-10-25 20:50:36 +0100
committerXavier Noria <fxn@hashref.com>2009-10-25 20:51:56 +0100
commitd226287855800e1eec58cd35ed3aac5cd9fbf630 (patch)
treeb03fc0e1490dae239451cd990939668dc54f2b5f /railties/guides/source/active_support_core_extensions.textile
parent25ea652c7008df4d78c7da64893b3653c322d005 (diff)
downloadrails-d226287855800e1eec58cd35ed3aac5cd9fbf630.tar.gz
rails-d226287855800e1eec58cd35ed3aac5cd9fbf630.tar.bz2
rails-d226287855800e1eec58cd35ed3aac5cd9fbf630.zip
AS guide: documents the Range#overlaps?
Diffstat (limited to 'railties/guides/source/active_support_core_extensions.textile')
-rw-r--r--railties/guides/source/active_support_core_extensions.textile10
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+
...