then
keyword in multi-line pattern matching statement RB-C1015The then
keyword in pattern match cases is meant to be used for single-expression cases. In case you have a pattern whose body is on multiple lines, the then
keyword is not needed.
case expression
in pattern then
do_something
end
case expression
in pattern
do_something
end
# `then` is recommended for a single-line pattern match statement
case expression
in pattern then do_something
end
# `then` is still valid if `do_something` has it arguments in multiple lines
case expression
in pattern then do_something(arg1,
arg2)
end