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.



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

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.



13
14
15
# File 'lib/parallel.rb', line 13

def exception
  @exception
end