I'm looking for a statement that skips the execution of the when
block, similiar to break
for loops. Is this possible?
What I want to avoid is a construct like:
case n
when 1
if valid
foo.bar
end
when 2
if valid
foo.foo
end
The more desirable code block would look like:
case n
when 1
break unless valid
foo.bar
when 2
break unless valid
foo.foo
end
Obviously, break
does not work.