From: Kamil Kukura Date: 2002-01-31T05:44:29+09:00 Subject: test for presence in array I'm new to Ruby so now I just write simple scripts. Before I was coding in Perl, then did some stuff in C++, then used Java and now with Ruby I feel I can breath :) I ran into typical situation where I needed to test number x against a couple of values. What entered my mind is: [10, 20, 100, 500].include?(x) I like it but I think I would prefer to have x.in? [10, 20, 100, 500] I guess it could go into Comparable module. Or is there better /nicer/ way? -- Kamil