--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!
> 
> I found a strange thing.
> 
> Object.class
> =>Class
> Class.class
> =>Class
> 
> As you see, Object and Class are of same type.
>
> Object.methods.length
> =>73
> Class.methods.length
> =>74
> Class.methods - Object.methods
> =>["nesting"]
> 
> 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
=> [Object, Kernel]
irb(main):002:0> Class.ancestors
=> [Class, Module, Object, Kernel]

Class and Module have a nesting, while classes not descended from Class
or Module do not.

-- 
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+nzFShcRge7ZlccDd
-----END PGP SIGNATURE-----

--v9Ux+11Zm5mwPlX6--