|
467 | 467 | # |
468 | 468 | # - Appended to a line of code |
469 | 469 | # that defines a class, module, method, alias, constant, or attribute. |
| 470 | +# |
470 | 471 | # - Specifies that the defined object should not be documented. |
471 | 472 | # |
| 473 | +# - For method definitions in C code, it must be placed before the |
| 474 | +# implementation: |
| 475 | +# |
| 476 | +# /* :nodoc: */ |
| 477 | +# static VALUE |
| 478 | +# some_method(VALUE self) |
| 479 | +# { |
| 480 | +# return self; |
| 481 | +# } |
| 482 | +# |
| 483 | +# Note that this directive has <em>no effect at all</em> at method |
| 484 | +# definition places. E.g., |
| 485 | +# |
| 486 | +# /* :nodoc: */ |
| 487 | +# rb_define_method(cMyClass, "do_something", something_func, 0); |
| 488 | +# |
| 489 | +# The above comment is just a comment and has nothing to do with \RDoc. |
| 490 | +# Therefore, +do_something+ method will be reported as "undocumented" |
| 491 | +# unless that method or function is documented elsewhere. |
| 492 | +# |
| 493 | +# - For constant definitions in C code, this directive <em>can not work</em> |
| 494 | +# because there is no "implementation" place for constants. |
| 495 | +# |
472 | 496 | # - <tt># :nodoc: all</tt>: |
473 | 497 | # |
474 | 498 | # - Appended to a line of code |
|
502 | 526 | # #++ |
503 | 527 | # # Documented. |
504 | 528 | # |
505 | | -# For C code, any of directives <tt>:startdoc:</tt>, <tt>:enddoc:</tt>, |
506 | | -# and <tt>:nodoc:</tt> may appear in a stand-alone comment: |
| 529 | +# For C code, any of directives <tt>:startdoc:</tt>, <tt>:stopdoc:</tt>, |
| 530 | +# and <tt>:enddoc:</tt> may appear in a stand-alone comment: |
507 | 531 | # |
508 | 532 | # /* :startdoc: */ |
509 | 533 | # /* :stopdoc: */ |
|
1192 | 1216 | # |
1193 | 1217 | class RDoc::MarkupReference |
1194 | 1218 |
|
| 1219 | + # exmaple class |
1195 | 1220 | class DummyClass; end |
| 1221 | + |
| 1222 | + # exmaple module |
1196 | 1223 | module DummyModule; end |
| 1224 | + |
| 1225 | + # exmaple singleton method |
1197 | 1226 | def self.dummy_singleton_method(foo, bar); end |
| 1227 | + |
| 1228 | + # example instance method |
1198 | 1229 | def dummy_instance_method(foo, bar); end; |
| 1230 | + |
1199 | 1231 | alias dummy_instance_alias dummy_instance_method |
| 1232 | + |
| 1233 | + # exmaple attribute |
1200 | 1234 | attr_accessor :dummy_attribute |
| 1235 | + |
1201 | 1236 | alias dummy_attribute_alias dummy_attribute |
| 1237 | + |
| 1238 | + # exmaple constant |
1202 | 1239 | DUMMY_CONSTANT = '' |
1203 | 1240 |
|
1204 | 1241 | # :call-seq: |
|
0 commit comments