aboutsummaryrefslogtreecommitdiffstats
path: root/railties/guides/source/active_support_core_extensions.textile
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2009-12-16 23:47:49 +0100
committerXavier Noria <fxn@hashref.com>2009-12-16 23:47:49 +0100
commit64eee76541e56d1230f2fdcab318ea81bf786e80 (patch)
tree53aef67ca252c5afb7449b168163552875a536cf /railties/guides/source/active_support_core_extensions.textile
parent25550d902260e398a836ee7be13a33369ae24510 (diff)
downloadrails-64eee76541e56d1230f2fdcab318ea81bf786e80.tar.gz
rails-64eee76541e56d1230f2fdcab318ea81bf786e80.tar.bz2
rails-64eee76541e56d1230f2fdcab318ea81bf786e80.zip
AS guide: documents Enumerable#exclude?
Diffstat (limited to 'railties/guides/source/active_support_core_extensions.textile')
-rw-r--r--railties/guides/source/active_support_core_extensions.textile8
1 files changed, 8 insertions, 0 deletions
diff --git a/railties/guides/source/active_support_core_extensions.textile b/railties/guides/source/active_support_core_extensions.textile
index 81b6894f74..4b8e2ef691 100644
--- a/railties/guides/source/active_support_core_extensions.textile
+++ b/railties/guides/source/active_support_core_extensions.textile
@@ -864,6 +864,14 @@ If an optional block is given +many?+ only takes into account those elements tha
@see_more = videos.many? {|video| video.category == params[:category]}
</ruby>
+h4. +exclude?+
+
+The predicate +exclude?+ tests whether a given object does *not* belong to the collection. It is the negation of the builtin +include?+:
+
+<ruby>
+to_visit << node if visited.exclude?(node)
+</ruby>
+
h3. Extensions to +Array+
h4. Accessing