Forum: Ruby how to check if script in a file a method?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
konsu (Guest)
on 2006-02-24 20:26
(Received via mailing list)

given a text string with ruby code, that my program evaluates at some
inside an anonymous module, is there a way to analyse the code without
evaluating it inside a module to tell if it implements a particular

i have a bunch of strings like that and i want to present the list of
to the user but i need to show what these scripts do so that she could
choose. after that i do evaluate the chosen one in a module and use it.
evaluating all of them and using respond_to? before displaying the
list seems ugly. is parsing the only alternative?

something similar to lisp's quote operator (which turns any list in to
a data list)?

This topic is locked and can not be replied to.