Is there a way to have method names to be part of documentation for a class (for instance to look like this http://www.rubydoc.info/gems/activerecord/4.2.0/ActiveRecord/Explain) , if the methods were defined with define_method in a loop?
Code below for illustrative purposes - to be able to get the "methods" section in docs for this class to contain get_sunday, get_monday , etc..
WEEKDAYS.each do |day|
#get all entities of a type e.g. get_nodes, get_pods, etc.
define_method("get_#{day}) do ....
#some logic here
end
end
I saw that rdoc allows to specify :method, but it seems that it allows hardcoding the method name, while here I am looking whether a dynamic way exists to do it in a loop.