Ruby: Don't a add return in ensure

Posted Almost 11 years ago. Visible to the public.

This method won't throw an error:

def a_method
  raise
ensure
  return :something
end

it will in fact return :something

So please proceed with care :)

Dragos Miron
Last edit
Almost 9 years ago
dncrht
Tags
Posted by Dragos Miron to HouseTrip Deck (2013-04-18 10:15)