--Sig_/Y04xXzr3Sb31R.JDL2GwrJA Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Hello, "Stefan Lang" <perfectly.normal.hacker / gmail.com> wrote: > "class << Array" opens the eigenclass of the Array object. > Thus the foo method is only defined for the Array object itself. > > "Array.class" returns the class of the Array object, which is Class. > Defining a method with module_eval in there means that it > is defined for _all_ class objects. > > To demonstrate this, try to call the methods on another class: > > irb(main):017:0> String.foo > NoMethodError: undefined method `foo' for String:Class > from (irb):17 > irb(main):018:0> String.bar > "inside bar" > > Stefan > thank you! Greetings, Niklas --Sig_/Y04xXzr3Sb31R.JDL2GwrJA Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFIrW+5saTI7fa8xRURAp7BAJ9nkj8L0uYFuzoE4VFsFqnZRcQvXQCfYJGc CGT0p15Zt4ioUKzo5at4eKU S6 -----END PGP SIGNATURE----- --Sig_/Y04xXzr3Sb31R.JDL2GwrJA--