From: Meinrad Recheis Date: 2006-03-07T18:39:49+09:00 Subject: best praxis to wrap methods? ------=_Part_1901_6993034.1141724373102 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline hello fellow rubyists, is there an elegant way to define a singleton method from a given symbol without using eval? what i am doing is this: def make_wrapper object, method eval %{ def object.#{method} # do something here super # call the wrapped method end } end # example of usage: make_wrapper STDOUT, :puts using eval works, but it seems not to be the best solution. is there annother way do define methods from a given symbol? -- henon ------=_Part_1901_6993034.1141724373102--