Class: Symbol

Inherits:
Object show all
Defined in:
lib/assay/ae/core_ext.rb

Instance Method Summary collapse

Instance Method Details

#thrown?(*args) ⇒ Boolean

Does the block throw this symbol? Throwing another symbol counts as no; any error is raised as usual.

Returns:

  • (Boolean)


116
117
118
119
120
121
122
123
124
125
# File 'lib/assay/ae/core_ext.rb', line 116

def thrown?(*args)
  catch(self) do
    begin
      yield(*args)
    rescue UncaughtThrowError
    end
    return false
  end
  return true
end