For example, I have the following code.
str = 'delay loss duplicate etc'
case str
when /delay/ then
puts 'delay'
when /loss/ then
puts 'loss'
end
I want give.
delay
loss
Is it possible in ruby not break all next conditions when the first coincidence?
I’m not sure
caseis really what you want here.If you want another regex, just add a key/value pair to the hash.