Method: RuboCop::Cop::Naming::MethodName#on_def

Defined in:
lib/rubocop/cop/naming/method_name.rb

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

[View source]

90
91
92
93
94
95
96
97
98
# File 'lib/rubocop/cop/naming/method_name.rb', line 90

def on_def(node)
  return if node.operator_method? || matches_allowed_pattern?(node.method_name)

  if forbidden_name?(node.method_name.to_s)
    register_forbidden_name(node)
  else
    check_name(node, node.method_name, node.loc.name)
  end
end