Class: RuboCop::Cop::Platanus::NoCommand
- Inherits:
-
Base
- Object
- Base
- RuboCop::Cop::Platanus::NoCommand
- Defined in:
- lib/rubocop/cop/platanus/no_command.rb
Overview
Usage of PowerTypes::Command is no longer recommended. Rails ApplicationJob should be used instead.
Constant Summary collapse
- MSG =
'Use `ApplicationJob` instead of `PowerTypes::Command`.'
Instance Method Summary collapse
Instance Method Details
#on_class(node) ⇒ Object
33 34 35 36 37 |
# File 'lib/rubocop/cop/platanus/no_command.rb', line 33 def on_class(node) return unless uses_powertypes_command?(node) add_offense(node) end |
#uses_powertypes_command?(node) ⇒ Object
29 30 31 |
# File 'lib/rubocop/cop/platanus/no_command.rb', line 29 def_node_matcher :uses_powertypes_command?, <<~PATTERN (class _ (send (const (const _ :PowerTypes) :Command) :new ...) _) PATTERN |