I
Iñaki Baz Castillo
Hi, I have this case:
class A ; end
class B < A ; end
class C < B ; end
a =3D A.new
b =3D B.new
c =3D C.new
I look for a way (***) to get the following results:
a)
a *** A =3D> true
a *** B =3D> false
a *** C =3D> false
b)
b *** A =3D> false (*1)
b *** B =3D> true
b *** C =3D> false
c)
c *** A =3D> false (*2)
c *** B =3D> true
c *** C =3D> true
Note that I could use =3D=3D=3D, so:
A =3D=3D=3D a =3D> true
A =3D=3D=3D b =3D> false
but in cases *1 and *2 the result is not what I want:
A =3D=3D=3D b =3D> true (I want false)
A =3D=3D=3D c =3D> true (I want false)
I could play with a.class.ancestors, but isn't another way?
Thanks a lot.
=2D-=20
I=C3=B1aki Baz Castillo <[email protected]>
class A ; end
class B < A ; end
class C < B ; end
a =3D A.new
b =3D B.new
c =3D C.new
I look for a way (***) to get the following results:
a)
a *** A =3D> true
a *** B =3D> false
a *** C =3D> false
b)
b *** A =3D> false (*1)
b *** B =3D> true
b *** C =3D> false
c)
c *** A =3D> false (*2)
c *** B =3D> true
c *** C =3D> true
Note that I could use =3D=3D=3D, so:
A =3D=3D=3D a =3D> true
A =3D=3D=3D b =3D> false
but in cases *1 and *2 the result is not what I want:
A =3D=3D=3D b =3D> true (I want false)
A =3D=3D=3D c =3D> true (I want false)
I could play with a.class.ancestors, but isn't another way?
Thanks a lot.
=2D-=20
I=C3=B1aki Baz Castillo <[email protected]>