Class: RuboCop::Cop::Style::SleepCop

Inherits:
RuboCop::Cop show all
Defined in:
lib/rubocop/style/sleepcop.rb

Overview

A cap to warn on any sleep calls.

Constant Summary collapse

MSG =
'Do not call sleep. Only call it your polling method ' \
'and decorate that with: rubocop:disable Style/SleepCop.'

Instance Method Summary collapse

Instance Method Details

#on_send(node) ⇒ Object



15
16
17
18
# File 'lib/rubocop/style/sleepcop.rb', line 15

def on_send(node)
  return unless node.method_name == :sleep
  add_offense(node, severity: :warning)
end