Class: RuboCop::Cop::Lint::BlockSleep
- Inherits:
-
Base
- Object
- Base
- RuboCop::Cop::Lint::BlockSleep
- Defined in:
- lib/rubocop/cop/lint/block_sleep.rb
Overview
TODO: Write cop description and example of bad / good code. For every ‘SupportedStyle` and unique configuration, there needs to be examples. Examples must have valid Ruby syntax. Do not use upticks.
Constant Summary collapse
- MSG =
TODO: Implement the cop in here.
In many cases, you can use a node matcher for matching node pattern. See github.com/rubocop-hq/rubocop-ast/blob/master/lib/rubocop/ast/node_pattern.rb
For example
'Use of sleep detected.'
Instance Method Summary collapse
Instance Method Details
#on_send(node) ⇒ Object
54 55 56 57 58 |
# File 'lib/rubocop/cop/lint/block_sleep.rb', line 54 def on_send(node) return unless use_sleep?(node) add_offense(node, severity: :refactor) end |