ruby reflection of methods

R

Ray Case

If I do something like:
meth=method:)send) (or any other method)

is there anyway to get the actual text of the send method? like
meth.body or something?

I don't actually need the text of the method, I was just wondering.

Ray
 
G

Giles Bowkett

If I do something like:
meth=method:)send) (or any other method)

is there anyway to get the actual text of the send method? like
meth.body or something?

I don't actually need the text of the method, I was just wondering.

There is such a way. Use the mighty and impressive Ruby2Ruby gem. It's
downright scary.

teh IRB session:
=> "def drink\n "glug"\nend"

--
Giles Bowkett

Podcast: http://hollywoodgrit.blogspot.com
Blog: http://gilesbowkett.blogspot.com
Portfolio: http://www.gilesgoatboy.org
Tumblelog: http://giles.tumblr.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top