Class: Ducalis::DescriptiveBlockNames

Inherits:
RuboCop::Cop::Cop
  • Object
show all
Defined in:
lib/ducalis/cops/descriptive_block_names.rb

Constant Summary collapse

OFFENSE =
<<-MESSAGE.gsub(/^ +\|\s/, '').strip
  | Please, use descriptive names as block arguments. There is no any sense to save on letters.
MESSAGE

Instance Method Summary collapse

Instance Method Details

#on_block(node) ⇒ Object



11
12
13
14
15
16
# File 'lib/ducalis/cops/descriptive_block_names.rb', line 11

def on_block(node)
  _send, args, _inner = *node
  block_arguments(args).each do |violation_node|
    add_offense(violation_node, :expression, OFFENSE)
  end
end