From: itsme213 Date: 2004-11-08T15:48:35+09:00 Subject: how to define "global" function from within class method? I have defined class X. Anytime X is inherited (say, by Y), I want to generate a global function definition def y(...) { ... } The hook I am using is class X def self.inherited(child) ... end end What should go into the ...? Should it be Object.class_eval "def #{child.name.downcase} ... end" ? Thanks