From: tamouse mailing lists Date: 2013-03-14T17:27:16+09:00 Subject: Re: question on watir --f46d040169bd4a0d1f04d7de49bc Content-Type: text/plain; charset=UTF-8 On Mar 14, 2013 2:45 AM, "Raj pal" wrote: > > hi, I am comparing objects like > > if a.class.to_s == 'hash' > puts 'hash' > end > > Is there any way can i compare objects directly? > > Like if a.class==OBJECT > puts 'hash' > end > > -- > Posted via http://www.ruby-forum.com/. > Not quite getting what you want, but would === or is_a? work? --f46d040169bd4a0d1f04d7de49bc Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


On Mar 14, 2013 2:45 AM, "Raj pal" <lists@ruby-forum.com> wrote:
>
> hi, I am comparing objects like
>
> if a.class.to_s =3D=3D 'hash'
> =C2=A0 =C2=A0puts 'hash'
> end
>
> Is there any way can i compare objects directly?
>
> Like if a.class=3D=3DOBJECT
> =C2=A0 =C2=A0 =C2=A0 =C2=A0puts 'hash'
> end
>
> --
> Posted via http://www.ruby-foru= m.com/.
>

Not quite getting what you want, but would =3D=3D=3D or is_a? work?

--f46d040169bd4a0d1f04d7de49bc--