Class: Ducalis::PublicSend
- Inherits:
-
RuboCop::Cop::Cop
- Object
- RuboCop::Cop::Cop
- Ducalis::PublicSend
- Defined in:
- lib/ducalis/cops/public_send.rb
Constant Summary collapse
- OFFENSE =
<<-MESSAGE.gsub(/^ +\|\s/, '').strip | You should avoid of using `send`-like method in production code. You can rewrite it as a hash with lambdas and fetch necessary actions or rewrite it as a module which you can include in code. MESSAGE
Instance Method Summary collapse
Instance Method Details
#on_send(node) ⇒ Object
11 12 13 14 15 |
# File 'lib/ducalis/cops/public_send.rb', line 11 def on_send(node) return unless send_call?(node) add_offense(node, :expression, OFFENSE) end |