Module: RuboCop::Cop::SymbolHelp

Included in:
Lint::SymbolConversion, RuboCop::Cop::Style::QuotedSymbols
Defined in:
lib/rubocop/cop/mixin/symbol_help.rb

Overview

Classes that include this module just implement functions for working with symbol nodes.

Instance Method Summary collapse

Instance Method Details

#hash_key?(node) ⇒ Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/rubocop/cop/mixin/symbol_help.rb', line 8

def hash_key?(node)
  node.parent&.pair_type? && node == node.parent.child_nodes.first
end