Class: CustomCops::MethodMissing

Inherits:
RuboCop::Cop::Base
  • Object
show all
Defined in:
lib/simplycop/custom_cops/method_missing.rb

Overview

This cop checks for the presence of ‘method_missing`

Examples:

#bad
def method_missing
end

#good

not using method missing

Constant Summary collapse

MSG =
'Avoid method missing.'

Instance Method Summary collapse

Instance Method Details

#on_def(node) ⇒ Object Also known as: on_defs



18
19
20
21
22
# File 'lib/simplycop/custom_cops/method_missing.rb', line 18

def on_def(node)
  return unless node.method?(:method_missing)

  add_offense(node)
end