Skip to content

Instantly share code, notes, and snippets.

@Animesh-Ghosh
Created October 23, 2024 18:01
Show Gist options
  • Select an option

  • Save Animesh-Ghosh/fffe5aa7432ce63b875db24e2f66f163 to your computer and use it in GitHub Desktop.

Select an option

Save Animesh-Ghosh/fffe5aa7432ce63b875db24e2f66f163 to your computer and use it in GitHub Desktop.
Ruby WTF
def foo
return :bar
ensure
p :foo
end
foo # => :bar but prints :foo before returning
def foo
return :bar
ensure
return :baz
end
foo # => returns :baz ?!?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment