开发者

Documenting constants and methods

开发者 https://www.devze.com 2023-03-15 07:55 出处:网络
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:

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 #:do开发者_Python百科c:
  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?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号