Class: Proc

Inherits:
Object show all
Defined in:
lib/subtle/exception.rb,
lib/subtle/safety_proc.rb,
lib/subtle/lambda_to_object.rb

Instance Method Summary collapse

Instance Method Details

#call_safelyObject



2
3
4
5
6
# File 'lib/subtle/safety_proc.rb', line 2

def call_safely
  self.call
rescue
  yield if block_given?
end

#exception_raisedObject



2
3
4
5
6
7
# File 'lib/subtle/exception.rb', line 2

def exception_raised
  self.call
  nil
rescue => e
  e
end

#to_objectObject



2
3
4
# File 'lib/subtle/lambda_to_object.rb', line 2

def to_object
  Subtle::LazyCover.new self
end