Class: RuboCop::Cop::AnyCable::PeriodicalTimers

Inherits:
Cop
  • Object
show all
Defined in:
lib/anycable/rails/compatibility/rubocop/cops/anycable/periodical_timers.rb

Overview

Checks for periodical timers usage.

Examples:

# bad
class MyChannel < ApplicationCable::Channel
  periodically(:do_something, every: 2.seconds)
end

Constant Summary collapse

MSG =
"Periodical Timers are not supported in AnyCable"

Instance Method Summary collapse

Instance Method Details

#on_send(node) ⇒ Object



23
24
25
# File 'lib/anycable/rails/compatibility/rubocop/cops/anycable/periodical_timers.rb', line 23

def on_send(node)
  add_offense(node) if calls_periodically?(node)
end