Class: RuboCop::Cop::Style::PublicClassDocumentation

Inherits:
Documentation
  • Object
show all
Defined in:
lib/rubocop/cop/style/public_class_documentation.rb

Overview

TODO: Write cop description and example of bad / good code. For every ‘SupportedStyle` and unique configuration, there needs to be examples. Examples must have valid Ruby syntax. Do not use upticks.

Examples:

EnforcedStyle: PublicClassDocumentation (default)

# Description of the `PublicClassDocumentation` style.

# bad
class xxx

# bad
# class xxx documentation
class xxx

# bad
# class xxx documentation
# the end
class xxx

# good
# class xxx documentation
#
class xxx

Instance Method Summary collapse

Instance Method Details

#on_class(node) ⇒ Object

overide method to add on my class doc

Parameters:

  • :node a class node



44
45
46
47
# File 'lib/rubocop/cop/style/public_class_documentation.rb', line 44

def on_class(node)
  check_class_comment(node, :class)
  super
end