-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Martin Boese wrote:
| Is it possible to create classes with a dynamic name? Example:
|
| name = "Test"
|
| class name		# this fails
|  def write
|     puts "TEST"
|   end
| end
|
| puts Object::const_get(name).new.write		# => "TEST"
|
|
|
Yes. Here is an overview on metaprogramming, and two ways to create
classes dynamically:

http://ola-bini.blogspot.com/2006/09/ruby-metaprogramming-techniques.html

- -- Phillip Gawlowski
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEUEARECAAYFAkfzWNEACgkQbtAgaoJTgL9KhACfY0UzhdcpPeOYMYaOgjfUpT35
dAwAl3hEZTSDs6+M6U0givW4nk68iGU=
=44gD
-----END PGP SIGNATURE-----