Class: RuboCop::Cop::Discourse::Plugins::NamespaceMethods
- Inherits:
-
Base
- Object
- Base
- RuboCop::Cop::Discourse::Plugins::NamespaceMethods
- Defined in:
- lib/rubocop/cop/discourse/plugins/namespace_methods.rb
Overview
Methods must be defined inside the plugin namespace (module or class).
Constant Summary collapse
- MSG =
"Don’t define methods outside a class or a module."
Instance Method Summary collapse
Instance Method Details
#on_def(node) ⇒ Object
23 24 25 26 |
# File 'lib/rubocop/cop/discourse/plugins/namespace_methods.rb', line 23 def on_def(node) return if inside_namespace?(node) add_offense(node, message: MSG) end |