I'm not sure if this is actually possible or not but I'm trying to make the documentation of our rails app more complete by adding documentation for the scopes in our app/models
files. What I'm looking to try and do is:
# This is a description of what the scope does and the action that it performs
scope :newest_records, order("created_at desc").limit(50)
And then when I run rdoc over the app I want to see newest_records
listed as a public class method along with the more traditional methods which will get documented like:
# some more documentation about this method
def self.a_class method
....
end
EDIT
I realise this question may be a bit ambiguous. So here's an attempt to clarify: At present when I try to add a comment line above a scope
declaration I get NO documentation generated by RDoc for the scope. I know RDoc can pick up meta methods/attributes otherwise it wouldn't be displaying attributes in the docs which are declared with attr_accessor
. So my question is how do I add comments to my file so that :
- The method appears in my RDoc generated documentation
- It appears as a public class method (as opposed to public instance method etc)