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.
C94afbb820c49a847b3b1f5244178f82?d=identicon&s=25 Eduardo Blumenfeld (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
5b972395a92333843018b4add8af0437?d=identicon&s=25 Damián M. González (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.