Class: Ducalis::ParamsPassing

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

Constant Summary collapse

OFFENSE =
<<-MESSAGE.gsub(/^ +\|\s/, '').strip
  | It's better to pass already preprocessed params hash to services. Or you can use `arcane` gem.
MESSAGE
PARAMS_CALL =
s(:send, nil, :params)

Instance Method Summary collapse

Instance Method Details

#on_send(node) ⇒ Object



13
14
15
16
17
# File 'lib/ducalis/cops/params_passing.rb', line 13

def on_send(node)
  _who, _what, *args = *node
  node = inspect_args(args)
  add_offense(node, :expression, OFFENSE) if node
end