RuboCop::Cop
This cop checks for when; uses in case expressions.
# File lib/rubocop/cop/style/when_then.rb, line 15 def autocorrect(node) @corrections << lambda do |corrector| corrector.replace(node.loc.begin, ' then') end end
# File lib/rubocop/cop/style/when_then.rb, line 9 def on_when(node) return unless node.loc.begin && node.loc.begin.is?(';') add_offense(node, :begin) end
[Validate]
Generated with the Darkfish Rdoc Generator 2.