Parent

Files

Class/Module Index [+]

Quicksearch

RuboCop::Cop::Style::ClassAndModuleChildren

This cop checks the style of children definitions at classes and modules. Basically there are two different styles:

nested - have each child on its own line

class Foo
  class Bar
  end
end

compact - combine definitions as much as possible

class Foo::Bar
end

The compact style is only forced, for classes / modules with one child.

Public Instance Methods

on_class(node) click to toggle source
# File lib/rubocop/cop/style/class_and_module_children.rb, line 28
def on_class(node)
  _name, _superclass, body = *node
  check_style(node, body)
end
on_module(node) click to toggle source
# File lib/rubocop/cop/style/class_and_module_children.rb, line 33
def on_module(node)
  _name, body = *node
  check_style(node, body)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.