Class: ZTK::Parallel::ExceptionWrapper

Inherits:
Object
  • Object
show all
Defined in:
lib/ztk/parallel.rb

Overview

Tests if we can marshal an exception via the results; otherwise creates an exception we can marshal.

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (ExceptionWrapper) initialize(exception)

Returns a new instance of ExceptionWrapper



56
57
58
59
60
# File 'lib/ztk/parallel.rb', line 56

def initialize(exception)
  dumpable = (Marshal.dump(exception) rescue nil)
  dumpable.nil? and (exception = RuntimeError.new(exception.inspect))
  @exception = exception
end

Instance Attribute Details

- (Object) exception (readonly)

Returns the value of attribute exception



54
55
56
# File 'lib/ztk/parallel.rb', line 54

def exception
  @exception
end