@@ -440,14 +440,16 @@ NOTE: Defined in +active_support/core_ext/kernel/reporting.rb+.
...
@@ -440,14 +440,16 @@ NOTE: Defined in +active_support/core_ext/kernel/reporting.rb+.
h4. +in?+
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?+:
Examples of +in?+:
<ruby>
<ruby>
1.in?(1,2) # => true
1.in?([1,2]) # => true
1.in?([1,2]) # => true
"lo".in?("hello") # => true
"lo".in?("hello") # => true
25.in?(30..50) # => false
25.in?(30..50) # => false
1.in?(1) # => ArgumentError
</ruby>
</ruby>
NOTE: Defined in +active_support/core_ext/object/inclusion.rb+.
NOTE: Defined in +active_support/core_ext/object/inclusion.rb+.