Permalink
Browse files

AS guide: documents the Range#overlaps?

  • Loading branch information...
1 parent 25ea652 commit d226287855800e1eec58cd35ed3aac5cd9fbf630 @fxn fxn committed Oct 25, 2009
Showing with 10 additions and 0 deletions.
  1. +10 −0 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+
...

0 comments on commit d226287

Please sign in to comment.