Permalink
Browse files

AS guide: documents Enumerable#none?

  • Loading branch information...
1 parent 586fe4d commit b1cdd97ce53821729e4fa21977eb25bffe263a4e @fxn fxn committed Sep 22, 2009
Showing with 10 additions and 0 deletions.
  1. +10 −0 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

0 comments on commit b1cdd97

Please sign in to comment.