If the source of the any method is written explicitly in a file, there is a neat method to display the code:
A.instance_method(:foo).source
but if i define class and methods in it dynamically with
Object.const_set(dynamic_name, Class.new { def foo() puts 'bar' end })
i receive an error when try to get the source of this method, when use instance_method(:foo).source
in this case
MethodSource::SourceNotFoundError: Could not load source for : No such file or directory @ rb_sysopen - (eval)
How can i get the source of dynamically defined method? Is it possible at all?