Class Roodi::Checks::CaseMissingElseCheck
In: lib/roodi/checks/case_missing_else_check.rb
Parent: Roodi::Checks::Check

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,

Methods

Public Instance methods

[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

[Source]

# File lib/roodi/checks/case_missing_else_check.rb, line 11
      def interesting_nodes
        [:case]
      end

[Validate]