From: Eric Hodel Date: 2004-06-22T05:34:18+09:00 Subject: Re: A question about Class and Object --v9Ux+11Zm5mwPlX6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Sam Sungshik Kong (ssk@chol.nospam.net) wrote: > Hello! >=20 > I found a strange thing. >=20 > Object.class > =3D>Class > Class.class > =3D>Class >=20 > As you see, Object and Class are of same type. > > Object.methods.length > =3D>73 > Class.methods.length > =3D>74 > Class.methods - Object.methods > =3D>["nesting"] >=20 > I expected that Object has same methods as Class but it's not. > Can somebody explain and teach me please? See Module#nesting in ri irb(main):001:0> Object.ancestors =3D> [Object, Kernel] irb(main):002:0> Class.ancestors =3D> [Class, Module, Object, Kernel] Class and Module have a nesting, while classes not descended from Class or Module do not. --=20 Eric Hodel - drbrain@segment7.net - http://segment7.net All messages signed with fingerprint: FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04 --v9Ux+11Zm5mwPlX6 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (FreeBSD) iD8DBQFA10ZIMypVHHlsnwQRAhn2AJ9FR+xXFN+XCDX13dS5tY9bGHZOkQCfRKyB NcG8G28T+nzFShcRge7Zlcc= =M6Dd -----END PGP SIGNATURE----- --v9Ux+11Zm5mwPlX6--