class RuboCop::Cop::Style::BracesAroundHashParameters
def autocorrect(send_node)
the AST has changed, a braceless hash would not be parsed as a hash
node, because that context is needed. When parsing the code to see if
We let AutocorrectUnlessChangingAST#autocorrect work with the send
def autocorrect(send_node) hash_node = send_node.last_argument lambda do |corrector| if hash_node.braces? remove_braces_with_whitespace(corrector, hash_node) else add_braces(corrector, hash_node) end end end