Question

I have a series of Ruby methods andI would like to dump their return values out to a formatted report. However, I'd also like to annotate these results (i.e. with descriptions of what the value is), and I was wondering if I could use the existing comments on each method to do this annotating?

So I guess what I want to do is output the rdoc as normal but for each method actually run the method with an argument. The argument is the same for every single method, which simplifies it.

Was it helpful?

Solution

with 1.9 there is a Method#source_location that might be helpful for you (ripper might help,too). Also note: http://github.com/rdp/arguments might be helpful

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top