when

Works with the case construct. You can define conditions to occur when the WHEN expression is true.

Syntax

case [expression] when ... end