Skip to content

Instantly share code, notes, and snippets.

@davidcelis
Created September 16, 2012 15:35
Show Gist options
  • Save davidcelis/3732872 to your computer and use it in GitHub Desktop.
Save davidcelis/3732872 to your computer and use it in GitHub Desktop.
Ruby exception scopes in methods
# These two chunks of code are the same, because method have inherent exception scopes
def method
begin
"hello".this_method_doesnt_exist
rescue NoMethodError => e
puts e
end
end
def method
"hello".this_method_doesnt_exist
rescue NoMethodError => e
puts e
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment