module RuboCop::Cop::ArraySyntax
Common code for ordinary arrays with [] that can be written with % syntax.
Public Instance Methods
bracketed_array_of?(element_type, node)
click to toggle source
# File lib/rubocop/cop/mixin/array_syntax.rb, line 7 def bracketed_array_of?(element_type, node) return false unless node.square_brackets? && node.values.size > 1 node.values.all? { |value| value.type == element_type } end