Class: Object

Inherits:
BasicObject
Defined in:
lib/tryit.rb

Instance Method Summary collapse

Instance Method Details

#tryit(*args, &block) ⇒ Object



13
14
15
16
17
18
19
20
21
# File 'lib/tryit.rb', line 13

def tryit(*args, &block)
  if args.empty? && block_given?
    instance_eval &block
  else
    send(*args, &block)
  end
rescue *TryIt.exceptions => e
  TryIt.handler.call(e)
end