Class: Symbol

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

Instance Method Summary collapse

Instance Method Details

#thrown?(*args) ⇒ Boolean

Does the block throw this symbol?

Returns:

  • (Boolean)


184
185
186
187
188
189
190
191
192
193
194
# File 'lib/ae/core_ext.rb', line 184

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