From: David Vallner Date: 2006-10-02T19:12:52+09:00 Subject: Re: Creating modules --------------enigCDA118CC99E78AEB21E125BE Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable benjohn@fysh.org wrote: > But the module doesn't have an constant associated with it, so I'm > getting an error from... >=20 > class MyModuleClass < Module > def initialize(a_constant_to_go_in_module) > module self > K =3D a_constant_to_go_in_module > def a_method; end > ... > end > end > end >=20 > Is there a way to do this, or do I have to start using the define_metho= d > and const_set methods? >=20 See David Black's post in the "dynamic include" thread. The module declaration creates a new independent scope, so you have to use the meta methods. David Vallner --------------enigCDA118CC99E78AEB21E125BE Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (MingW32) iD8DBQFFIOYny6MhrS8astoRAv3uAJ0aj6+eOKrz6xPPPi+qN6GX78Y74gCfbiqr IPbIXlwpsALzzu1Wypd63aM= =6N3e -----END PGP SIGNATURE----- --------------enigCDA118CC99E78AEB21E125BE--