Forum: Ruby Rdoc inside method or function definition

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Ccabb5c41e9b0160079a9aef6bd30ff0?d=identicon&s=25 Eduardo B. (eblumenfeld)
on 2012-12-20 17:31
Hi All,

Could it be possible to have documentation comments for the rdoc inside
a method definition as:

Traditional:
--------------------
# comment 1
# comment 2
def foo(*args)
   ...
end
--------------------

what I would like:
--------------------
def foo(*args)
   # comment 1
   # comment 2
   ...
end
--------------------

And still appear in the rdoc document?

Is this a silly question?

Regards,

Eduardo
806d422e42548daa68749f38031ecd40?d=identicon&s=25 Damián M. G. (igorjorobus)
on 2012-12-20 23:19
You can't. But when the method is documented you can show the source
code(in the .html generated), and there you can see the comments inside
the method definition.
This topic is locked and can not be replied to.