summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2007-12-05 01:56:29 +0100
committerChristian Neukirchen <chneukirchen@gmail.com>2007-12-05 01:56:29 +0100
commitf41bc742a0bc006cfdf02c014f90ba2b613ee292 (patch)
tree869547486546430fa8f3268ec6d81806528097b3 /lib
parent4b38b8e7b8943c91c72fa1b5f74c64f9ca94f6d1 (diff)
downloadbacon-f41bc742a0bc006cfdf02c014f90ba2b613ee292.tar.gz
bacon-f41bc742a0bc006cfdf02c014f90ba2b613ee292.tar.xz
bacon-f41bc742a0bc006cfdf02c014f90ba2b613ee292.zip
Add should.throw
darcs-hash:20071205005629-4fc50-9383518bf564264235d38f2fbd3059cccb6d3885.gz
Diffstat (limited to 'lib')
-rw-r--r--lib/bacon.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/bacon.rb b/lib/bacon.rb
index 0261c88..74d2a94 100644
--- a/lib/bacon.rb
+++ b/lib/bacon.rb
@@ -181,6 +181,14 @@ class Proc
   else
     false
   end
+
+  def throw?(sym)
+    catch(sym) {
+      call
+      return false
+    }
+    return true
+  end
 end
 
 class Float