From: "Jesús Gabriel y Galán" Date: 2010-06-15T02:36:57+09:00 Subject: Re: Metaprograming On Mon, Jun 14, 2010 at 7:20 PM, Rein Henrichs wrote: > My goodness. Has anyone asked why such metaprogramming might be necessary? I > don't even understand the question, let enough to the extent that I would > feel confident in suggesting such drastic measures as the solution. It's what I understood from the OP. He said: "suppose if i have not define some method then i will define it dynamically" From this and the rest of his question, I understood he wanted to intercept calls to missing methods and define them dynamically. Do you understand something different? > Metaprogramming is not a universal hammer. Even if it were, you wouldn't > want everything to be a nail. I can agree with this, but when the OP explicitly asks for a way to dynamically define missing methods, this is what comes to my mind. Of course, it might very well be the case that to solve OP's problem, this is not necessary at all and that studying his original problem might lead to a different solution, but in any case I see no harm in explaining him method_missing and how to define methods. Feel free to ask him about what problem he is trying to solve, and maybe we can come up with a better solution. Regards, Jesus.