class Symbol

Public Instance Methods

thrown?(*args) { |*args| ... } click to toggle source

Does the block throw this symbol?

# File lib/ae/core_ext/helpers.rb, line 173
def thrown?(*args)
  catch(self) do
    begin
      yield(*args)
    rescue ArgumentError  # 1.9 exception
    rescue NameError      # 1.8 exception
    end
    return false
  end
  return true
end