From: Martin Weber Date: 2003-01-08T23:30:51+09:00 Subject: Re: Can you detect if a method takes a block argument? Quick shot, suppose ruby wizards can make this still better. def use_block?(invoke) catch (:block) do eval "#{invoke} do throw :block, true end" end or false end pass the call you want to check along with arguments as string. > use_block?("print('3\n')") 3 => false > use_block?("[1,2,3].sort") => true -Martin