Module: RuboCop::Cop::DigHelp

Extended by:
Macros
Included in:
Style::DigChain, Style::SingleArgumentDig
Defined in:
lib/rubocop/cop/mixin/dig_help.rb

Overview

Help methods for working with ‘Enumerable#dig` in cops. Used by `Style::DigChain` and `Style::SingleArgumentDig`

Instance Method Summary collapse

Instance Method Details

#dig?(node) ⇒ Object



11
12
13
# File 'lib/rubocop/cop/mixin/dig_help.rb', line 11

def_node_matcher :dig?, <<~PATTERN
  (call _ :dig !{hash block_pass}+)
PATTERN

#single_argument_dig?(node) ⇒ Object



16
17
18
# File 'lib/rubocop/cop/mixin/dig_help.rb', line 16

def_node_matcher :single_argument_dig?, <<~PATTERN
  (send _ :dig $!splat)
PATTERN