Is there a way for programmatically accessing a method comments? or an attribute comments?
I would like to use it as a description for the method in a documentation which I don't want to be static or generated with rdoc or equivalent.
Here is an example of a Ruby class:
Class MyClass
##
# This method tries over and over until it is tired
def go_go_go(thing_to_try, tries = 10) # :args: thing_to_try
puts thing_to_try
go_go_go thing_to_try, tries - 1
end
end
Basically, I'd like to be able to do the following:
get_comment MyClass.gogogo # => This method tries over and over until it is tired