about summary refs log tree commit homepage
path: root/lib/yahns/config.rb
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2013-10-30 21:59:37 +0000
committerEric Wong <normalperson@yhbt.net>2013-10-31 05:04:36 +0000
commit602432714cd436b6f255e6ba6bc6fffbf5eca051 (patch)
tree079520490f4c8cc89320658f2e83b597ec376091 /lib/yahns/config.rb
parent5544418af3fb810ef90f33bcf88a434cd0349dc8 (diff)
downloadyahns-602432714cd436b6f255e6ba6bc6fffbf5eca051.tar.gz
It's usually given as a block, so Ruby won't care about arity there.
Users will get the worker ID number as the first arg, making it
possible to isolate some things to certain processes (e.g. for A/B
testing).
Diffstat (limited to 'lib/yahns/config.rb')
-rw-r--r--lib/yahns/config.rb7
1 files changed, 1 insertions, 6 deletions
diff --git a/lib/yahns/config.rb b/lib/yahns/config.rb
index 873722d..a46868b 100644
--- a/lib/yahns/config.rb
+++ b/lib/yahns/config.rb
@@ -103,13 +103,8 @@ class Yahns::Config # :nodoc:
   end
 
   def _add_hook(var, my_proc)
-    case my_proc
-    when Proc
-      my_proc.arity == 0 or raise ArgumentError,
-                         "#{var}=#{my_proc.inspect} should not take arguments"
-    else
+    Proc === my_proc or
       raise ArgumentError, "invalid type: #{var}=#{my_proc.inspect}"
-    end
 
     # this sets:
     # :atfork_prepare, :atfork_parent, :atfork_child