问题
I am writing a documentation for my Ruby on Rails 3.0.7 application using RDoc. In the application lib
folder, I have the following:
module ModuleName
class ModuleName::User < ActiveRecord::Base
#'CONSTANT' documentation text
CONSTANT = 'Test constant'
#'method_name' documentation text
def method_name
...
end
end
end
When I try to generate the documentation for the code above, RDoc will not parse the #'CONSTANT' documentation text
and the #'method_name' documentation text
, so the ouput documentation is blank.
1. How can I make RDoc to consider the commented code in the module "context"?
It doesn't help if I use the :doc:
directive as follows:
module ModuleName #:doc:
class ModuleName::User < ActiveRecord::Base #:doc:
#'CONSTANT' documentation text
CONSTANT = 'Test constant' #:doc:
#'method_name' documentation text
def method_name #:doc:
...
end
end
end
I note that I have these in the Class\Module Index:
ModuleName
ModuleName::ModuleName
ModuleName::ModuleName::ModuleName
ModuleName::ModuleName::ModuleName::User
2. What do they mean?
来源:https://stackoverflow.com/questions/6486923/documenting-constants-and-methods