Class: Parallel::ExceptionWrapper

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(exception) ⇒ ExceptionWrapper

Returns a new instance of ExceptionWrapper.



21
22
23
24
25
26
27
28
# File 'lib/parallel.rb', line 21

def initialize(exception)
  dumpable = Marshal.dump(exception) rescue nil
  unless dumpable
    exception = RuntimeError.new("Undumpable Exception -- #{exception.inspect}")
  end

  @exception = exception
end

Instance Attribute Details

#exceptionObject (readonly)

Returns the value of attribute exception.



20
21
22
# File 'lib/parallel.rb', line 20

def exception
  @exception
end