class RuboCop::Cop::Style::WhenThen
This cop checks for when; uses in case expressions.
Constants
- MSG
Public Instance Methods
autocorrect(node)
click to toggle source
# File lib/rubocop/cop/style/when_then.rb, line 16 def autocorrect(node) ->(corrector) { corrector.replace(node.loc.begin, ' then') } end
on_when(node)
click to toggle source
# File lib/rubocop/cop/style/when_then.rb, line 10 def on_when(node) return unless node.loc.begin && node.loc.begin.is?(';') add_offense(node, :begin) end