aboutsummaryrefslogtreecommitdiffstats
path: root/railties/guides
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2009-09-22 09:50:31 +0200
committerXavier Noria <fxn@hashref.com>2009-09-22 23:09:30 +0200
commitb1cdd97ce53821729e4fa21977eb25bffe263a4e (patch)
tree4eb644c6d37f78cfd04b0db5baf3a38d6b5d58ab /railties/guides
parent586fe4dc725ef9a92d39de1a4cac0ff6524b1b93 (diff)
downloadrails-b1cdd97ce53821729e4fa21977eb25bffe263a4e.tar.gz
rails-b1cdd97ce53821729e4fa21977eb25bffe263a4e.tar.bz2
rails-b1cdd97ce53821729e4fa21977eb25bffe263a4e.zip
AS guide: documents Enumerable#none?
Diffstat (limited to 'railties/guides')
-rw-r--r--railties/guides/source/active_support_overview.textile10
1 files changed, 10 insertions, 0 deletions
diff --git a/railties/guides/source/active_support_overview.textile b/railties/guides/source/active_support_overview.textile
index fde50b08ec..d8f6b31a65 100644
--- a/railties/guides/source/active_support_overview.textile
+++ b/railties/guides/source/active_support_overview.textile
@@ -900,6 +900,16 @@ 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. +none?+
+
+The method +none?+ is the negation of +any?+. It yields elements to a block and returns true if none of them matches:
+
+<ruby>
+success = responses.none? {|r| r.status / 100 == 5}
+</ruby>
+
+Ruby 1.8.7 and later already have +none?+, Active Support defines it for previous versions.
+
h3. Extensions to +Array+
h4. Accessing