Class: DeepTest::Worker::Error

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(work_unit, error) ⇒ Error

Returns a new instance of Error.



43
44
45
# File 'lib/deep_test/worker.rb', line 43

def initialize(work_unit, error)
  @work_unit, @error = work_unit, error
end

Instance Attribute Details

#errorObject

Returns the value of attribute error.



41
42
43
# File 'lib/deep_test/worker.rb', line 41

def error
  @error
end

#work_unitObject

Returns the value of attribute work_unit.



41
42
43
# File 'lib/deep_test/worker.rb', line 41

def work_unit
  @work_unit
end

Instance Method Details

#==(other) ⇒ Object



47
48
49
50
# File 'lib/deep_test/worker.rb', line 47

def ==(other)
  work_unit == other.work_unit &&
      error == other.error
end

#to_sObject



52
53
54
# File 'lib/deep_test/worker.rb', line 52

def to_s
  "#{@work_unit}: #{@error}\n" + (@error.backtrace || []).join("\n")
end