> Try eval: > > methName = "myMethod" > a = "test" > eval %{ > def #{ methName } > ... > end > } Yep; that should work. What if I want to create a global function? I assume I can use "class << SOMETHING", but I'm not sure what the SOMETHING would be. I'm guessing that if I put that code outside any classes then the eval will create a global function. I'll try that out. > Another possible solution is: > > class X > def create > def self.myMethod > p "in myMethod" > end > end > end Yep. I'd thought of that, but the functions are going to be created for arbitrary classes. If I can make this work, I'll be a very happy boy. At the moment, I feel like my chances are about 50-50 :-).