Parent

Roodi::Checks::CaseMissingElseCheck

Checks a case statement to make sure it has an 'else' clause.

It’s usually a good idea to have an else clause in every case statement. Even if the developer is sure that all currently possible cases are covered, this should be expressed in the else clause. This way the code is protected aginst later changes,

Public Instance Methods

evaluate_start(node) click to toggle source
# File lib/roodi/checks/case_missing_else_check.rb, line 15
def evaluate_start(node)
  add_error "Case statement is missing an else clause." unless node.last
end
interesting_nodes() click to toggle source
# File lib/roodi/checks/case_missing_else_check.rb, line 11
def interesting_nodes
  [:case]
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.