Parent

Included Modules

Files

Class/Module Index [+]

Quicksearch

RuboCop::Cop::Style::IfWithSemicolon

Checks for uses of semicolon in if statements.

Public Instance Methods

error_message(_node) click to toggle source
# File lib/rubocop/cop/style/if_with_semicolon.rb, line 13
def error_message(_node)
  'Never use if x; Use the ternary operator instead.'
end
offending_line(node) click to toggle source
# File lib/rubocop/cop/style/if_with_semicolon.rb, line 9
def offending_line(node)
  node.loc.begin.line if node.loc.begin && node.loc.begin.is?(';')
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.