--Sig_/fhAxJ8WoPif8H1gWKyFf
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:Array>"
"Class"
"inside foo"
"inside bar"
  
  ---- end ----


it obviously makes a difference because self.inspect returns two different values. but how is this practically relevant?

Greetings,
Niklas

--Sig_/fhAxJ8WoPif8H1gWKyFf
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
CmdpHAOzN4rlJ2drZPFnKmERr
-----END PGP SIGNATURE-----

--Sig_/fhAxJ8WoPif8H1gWKyFf--