123456789_123456789_123456789_123456789_123456789_

Module: RuboCop::Cop::ArraySyntax

Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Included In:
Defined in: lib/rubocop/cop/mixin/array_syntax.rb

Overview

Common code for ordinary arrays with [] that can be written with % syntax.

Instance Method Summary

Instance Method Details

#bracketed_array_of?(element_type, node) ⇒ Boolean (private)

[ GitHub ]

  
# File 'lib/rubocop/cop/mixin/array_syntax.rb', line 10

def bracketed_array_of?(element_type, node)
  return false unless node.square_brackets? && !node.values.empty?

  node.values.all? { |value| value.type == element_type }
end