Class: RuboCop::Cop::Betterment::ActiveJobPerformable

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

Constant Summary collapse

MSG =
<<~DOC
  Classes that are "performable" should be ActiveJobs

  class MyJob < ApplicationJob
    def perform
    end
  end

  You can learn more about ActiveJob here:
  https://guides.rubyonrails.org/active_job_basics.html
DOC

Instance Method Summary collapse

Instance Method Details

#on_class(node) ⇒ Object



27
28
29
30
31
32
# File 'lib/rubocop/cop/betterment/active_job_performable.rb', line 27

def on_class(node)
  return if subclasses_application_job?(node)
  return unless has_perform_method?(node)

  add_offense(node.identifier)
end