From: Niklas Baumstark Date: 2008-08-21T22:18:04+09:00 Subject: class << Array vs. Array.class --Sig_/fhAxJ8WoPif8H1gWKy=hyFf Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Hello, i just wondered where the difference between the following code parts is? ---- code ---- class << Array p self.inspect define_method :foo do p "inside foo" end end Array.class.module_eval do p self.inspect define_method :bar do p "inside bar" end end Array.foo Array.bar ---- output ---- "#" "Class" "inside foo" "inside bar" =20 ---- end ---- it obviously makes a difference because self.inspect returns two different = values. but how is this practically relevant? Greetings, Niklas --Sig_/fhAxJ8WoPif8H1gWKy=hyFf Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFIrWvssaTI7fa8xRURAqQoAKC51RfE59/6n9WWdcJhoPNnUU6ujwCggtEZ CmdpHAOzN4rlJ2drZPFnKmE= =ooRr -----END PGP SIGNATURE----- --Sig_/fhAxJ8WoPif8H1gWKy=hyFf--