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.



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

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.



18
19
20
# File 'lib/parallel.rb', line 18

def exception
  @exception
end