From: "Shot (Piotr Szotkowski)" Date: 2008-11-10T15:28:15+09:00 Subject: Re: how to find self class name inside self difinition ? --SUOF0GtieIMvvwua Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Thani Ararsu: > module Aa > end > class Aa::Name > def self.class_name > self.class.name > end > end > puts Aa::Name.class_name # 'Class' (This is correct; the object =E2=80=98Aa::Name=E2=80=99 is of class =E2=80= =98Class=E2=80=99.) > # But i want my class name as 'Aa::Name' instead of 'Class' You want the Module#name method: class Aa::Name def self.class_name name end end Aa::Name.class_name # =3D> 'Aa::Name' -- Shot --=20 MovableType is why my local whisky merchant isn't going out of business any time soon. -- Peter Corlett, hates-software --SUOF0GtieIMvvwua Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) iD8DBQFJF9aAi/mCfdEo8UoRAlbuAJ9gtWLdAlKLncFaGevwzS4hkRfRLwCcD3hW 3sbufqgwAAFOWLpOFL9ZyM8= =nm/D -----END PGP SIGNATURE----- --SUOF0GtieIMvvwua--