David Chelimsky
1/4/2008 3:15:00 PM
On Jan 4, 2008 9:05 AM, Sam Phoneix <dominicjefferies@yahoo.co.uk> wrote:
> How come this code doesn't return "true" for the following?
>
> x = [1,2,3]
>
> puts(x.include?(Fixnum))
It uses ==, not ===.
$ri Enumerable#include?
---------------------------------------------------- Enumerable#include?
enum.include?(obj) => true or false
enum.member?(obj) => true or false
------------------------------------------------------------------------
Returns +true+ if any member of _enum_ equals _obj_. Equality is
tested using +==+.