class RuboCop::Cop::Style::WordArray
def build_bracketed_array(node)
def build_bracketed_array(node) return '[]' if node.children.empty? words = node.children.map do |word| if word.dstr_type? string_literal = to_string_literal(word.source) trim_string_interpolation_escape_character(string_literal) else to_string_literal(word.children[0]) end end build_bracketed_array_with_appropriate_whitespace(elements: words, node: node) end