module RuboCop::AST::NodePattern::MethodDefiner

def emit_node_search(method_name)

def emit_node_search(method_name)
  if method_name.to_s.end_with?('?')
    on_match = 'return true'
  else
    args = emit_params(":#{method_name}", 'param0', forwarding: true)
    prelude = "return enum_for(#{args}) unless block_given?\n"
    on_match = emit_yield_capture(VAR)
  end
  emit_node_search_body(method_name, prelude: prelude, on_match: on_match)
end