class RuboCop::Cop::Style::EmptyLiteral
def correction(node)
def correction(node) if offense_array_node?(node) '[]' elsif str_node(node) preferred_string_literal elsif offense_hash_node?(node) if first_argument_unparenthesized?(node) # `some_method {}` is not same as `some_method Hash.new` # because the braces are interpreted as a block. We will have # to rewrite the arguments to wrap them in parenthesis. args = node.parent.arguments "(#{args[1..].map(&:source).unshift('{}').join(', ')})" else '{}' end end end