Posted over 8 years ago. Visible to the public.

Ruby: Don't a add return in ensure

This method won't throw an error:

Copy
def a_method raise ensure return :something end

it will in fact return :something

So please proceed with care :)

Owner of this card:

Avatar
Dragos Miron
Last edit:
about 6 years ago
by dncrht
Tags:
ensure, return
Posted by Dragos Miron to HouseTrip Deck
This website uses short-lived cookies to improve usability.
Accept or learn more