module RuboCop::Cop::IndexMethod

def prepare_correction(node)

def prepare_correction(node)
  if (match = on_bad_each_with_object(node))
    Autocorrection.from_each_with_object(node, match)
  elsif (match = on_bad_to_h(node))
    Autocorrection.from_to_h(node, match)
  elsif (match = on_bad_map_to_h(node))
    Autocorrection.from_map_to_h(node, match)
  elsif (match = on_bad_hash_brackets_map(node))
    Autocorrection.from_hash_brackets_map(node, match)
  else
    raise 'unreachable'
  end
end