Skip to content

Instantly share code, notes, and snippets.

@robhanlon22
Forked from dbalatero/output.txt
Created November 12, 2009 00:03
Show Gist options
  • Save robhanlon22/232444 to your computer and use it in GitHub Desktop.
Save robhanlon22/232444 to your computer and use it in GitHub Desktop.
RESCUED TYPE A
RESCUED TYPE B
test_splat_with_rescue.rb:8:in `a': ohhhhh we raised a type C (C)
from test_splat_with_rescue.rb:16
%w{SnoopDogg WarrenG NateDogg}.each {|e| const_set(e, Class.new(StandardError))}
def a(klass)
types = [SnoopDogg, WarrenG]
begin
raise klass, "ohhhhh we raised a type #{klass.to_s}"
rescue *types => error
puts "RESCUED TYPE #{klass.to_s}"
end
end
a(SnoopDogg)
a(WarrenG)
a(NateDogg)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment