# How to check if script in a file a method?

**URL:** <https://www.ruby-forum.com/t/how-to-check-if-script-in-a-file-a-method/72944>\
**Category:** Ruby\
**Created:** [February 24, 2006, 7:26pm UTC](https://www.ruby-forum.com/t/how-to-check-if-script-in-a-file-a-method/72944 "2006-02-24T19:26:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![konsu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/0ea827/32.png) [@konsu](https://www.ruby-forum.com/u/konsu)\
**Post date:** [February 24, 2006, 7:26pm UTC](https://www.ruby-forum.com/t/how-to-check-if-script-in-a-file-a-method/72944/1 "2006-02-24T19:26:16Z")

</div>

hello,

given a text string with ruby code, that my program evaluates at some  
point  
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  
method?

i have a bunch of strings like that and i want to present the list of  
them  
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  
selection  
list seems ugly. is parsing the only alternative?

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

thanks  
konstantin
