From: Frank Mittelbach Date: 2008-02-02T21:54:56+09:00 Subject: Re: inspecting the current definition of a method Phlip wrote: >> can one display the current definition of a method > > Unfortunately yes. You can use a library called 'rubynode' to reflect the > method's opcodes into a big array of hashes, describing each one. why unfortunately? because it is not straight forward? > However, Ruby is an extremely dynamic language, and it permits many > tricks using both basic OO programing, and meta-programming techniques > such as define_method. If you call define_method twice, with different > values in the variables around it each time, you can use those variables > inside the new method, and it will vary its behavior each time. understood. it is precisely one of the reasons that given this flexibility I would really like to be able "inspect" what a method in a given context does. The modification of this behavior would then be an additional plus, but just the plain seeing what the current definition is would be really helpful in some cases. but it seems that this is less straight forward than I have hoped thanks frank