class RuboCop::Cop::Style::EmptyLiteral
def autocorrect(node)
def autocorrect(node) name = case node when ARRAY_NODE '[]' when HASH_NODE # `some_method {}` is not same as `some_method Hash.new` # because the braces are interpreted as a block, so we avoid # the correction. Parentheses around the arguments would # solve the problem, but we let the user add those manually. return if first_arg_in_method_call_without_parentheses?(node) '{}' when STR_NODE if enforce_double_quotes? '""' else "''" end end ->(corrector) { corrector.replace(node.source_range, name) } end