Top-level class documentation

DreamWalker picture DreamWalker · Apr 6, 2016 · Viewed 24.4k times · Source

Rubycop outputs messages like:

app/controllers/welcome_controller.rb:1:1: C: Missing top-level class documentation comment.
class WelcomeController < ApplicationController
^^^^^

I wonder what does top-level class documentation look like. It's not just a comment, is it? It needs to have a special format, but which one?

Answer

lab419 picture lab419 · Jul 6, 2016

That said a simple comment like so will do nicely:

# This shiny device polishes bared foos
class FooBarPolisher
       ...

HTH