Class: Rubocop::Cop::InBatches

Inherits:
RuboCop::Cop::Base
  • Object
show all
Defined in:
lib/rubocop/cop/in_batches.rb

Overview

Cop that prevents the use of ‘in_batches`

Constant Summary collapse

MSG =
'Do not use `in_batches`, use `each_batch` from the EachBatch module instead'

Instance Method Summary collapse

Instance Method Details

#on_send(node) ⇒ Object



9
10
11
12
13
# File 'lib/rubocop/cop/in_batches.rb', line 9

def on_send(node)
  return unless node.children[1] == :in_batches

  add_offense(node.loc.selector)
end