aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTadas Tamošauskas <tadastoo@yahoo.com>2011-11-27 12:44:14 +0000
committerTadas Tamošauskas <tadastoo@yahoo.com>2011-11-27 12:44:14 +0000
commit9cf285599c1e99736f5dd9d01f986c19dcf3d4da (patch)
tree448fd3f679860080c2ceffd1d93a130ca67d6d3b
parent28e3935360c9392685c4954791cc320ed02e15c0 (diff)
downloadrails-9cf285599c1e99736f5dd9d01f986c19dcf3d4da.tar.gz
rails-9cf285599c1e99736f5dd9d01f986c19dcf3d4da.tar.bz2
rails-9cf285599c1e99736f5dd9d01f986c19dcf3d4da.zip
Update Object#in? description for https://github.com/rails/rails/pull/3767
-rw-r--r--railties/guides/source/active_support_core_extensions.textile4
1 files changed, 3 insertions, 1 deletions
diff --git a/railties/guides/source/active_support_core_extensions.textile b/railties/guides/source/active_support_core_extensions.textile
index d601e9ea29..c1046a3b63 100644
--- a/railties/guides/source/active_support_core_extensions.textile
+++ b/railties/guides/source/active_support_core_extensions.textile
@@ -440,14 +440,16 @@ NOTE: Defined in +active_support/core_ext/kernel/reporting.rb+.
h4. +in?+
-The predicate +in?+ tests if an object is included in another object. An +ArgumentError+ exception will be raised if the argument passed does not respond to +include?+.
+The predicate +in?+ tests if an object is included in another object or a list of objects. An +ArgumentError+ exception will be raised if a single argument is passed and it does not respond to +include?+.
Examples of +in?+:
<ruby>
+1.in?(1,2) # => true
1.in?([1,2]) # => true
"lo".in?("hello") # => true
25.in?(30..50) # => false
+1.in?(1) # => ArgumentError
</ruby>
NOTE: Defined in +active_support/core_ext/object/inclusion.rb+.