From: Aredridel Date: 2004-06-21T07:31:28+09:00 Subject: Re: the name of an class? On Mon, 2004-06-21 at 07:19 +0900, Karl-Heinz Wild wrote: > maybe a dummy question. sorry. > > class Base > def theName > # the name i would like return should be "Question" mean the name of > the class > # calling this function > end > end > > class Question < Base > def get( name ) > File.open( theName, 'r' ).each { | line | > puts line > } > end > end > > how can i get the name "Question" in a String. I need this as an > identifier. I think that what you want is self.class.name -- class Base def theName self.class.name end end