class RuboCop::Cop::Lint::DuplicateMethods

def possible_dsl?(node)

def possible_dsl?(node)
  # DSL methods may evaluate a block in the context of a newly created
  # class or module
  # Assume that if a method definition is inside any block call which
  # we can't identify, it could be a DSL
  node.each_ancestor(:block).any? do |ancestor|
    ancestor.method_name != :class_eval && !ancestor.class_constructor?
  end
end