--i9LlY+UWpKt15+FH
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Mon, Sep 26, 2005 at 10:38:16AM +0900, Ben wrote:
> The options I see are:
> 
> 1) Call .class.to_s on each parameter to match the type:
>         "pattern.class.to_s =~ /Array/ then # I have an array of regexp

You can do this:

if pattern.class == Array # then ...

Or this:

case pattern
  when Array
    # handle array
  when Regexp
    # handle Regexp
end

Or use this to ensure that pattern is always an Array:

pattern = [pattern] unless pattern.class == Array

-Ed

--i9LlY+UWpKt15+FH
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFDN1KJnhUz11p9MSARAgGuAJsFLCtlDvw5THZ0Qnt0CLczvkL+0QCg4XGy
OTpjNhrp1c3D0IM7KY/TUcQVY
-----END PGP SIGNATURE-----

--i9LlY+UWpKt15+FH--