Skip to content

Instantly share code, notes, and snippets.

@carlzulauf
Created March 20, 2012 21:52
Show Gist options
  • Save carlzulauf/2141673 to your computer and use it in GitHub Desktop.
Save carlzulauf/2141673 to your computer and use it in GitHub Desktop.
class STOP < Exception
def initialize(msg)
super
puts "STOP! #{msg}"
end
def time; Time.now; end
end
def Time.cant_touch_this
raise STOP.new("hammer time")
end
begin
Time.cant_touch_this
rescue STOP => hammer
puts hammer.time
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment