Class: DeepTest::Agent::Error

Inherits:
Object
  • Object
show all
Includes:
CentralCommand::Result
Defined in:
lib/deep_test/agent.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(work_unit, error) ⇒ Error

Returns a new instance of Error.



84
85
86
# File 'lib/deep_test/agent.rb', line 84

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

Instance Attribute Details

#errorObject

Returns the value of attribute error.



82
83
84
# File 'lib/deep_test/agent.rb', line 82

def error
  @error
end

#work_unitObject

Returns the value of attribute work_unit.



82
83
84
# File 'lib/deep_test/agent.rb', line 82

def work_unit
  @work_unit
end

Class Method Details

._load(string) ⇒ Object



94
95
96
# File 'lib/deep_test/agent.rb', line 94

def self._load(string)
  new *Marshal.load(string)
end

Instance Method Details

#==(other) ⇒ Object



98
99
100
101
# File 'lib/deep_test/agent.rb', line 98

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

#_dump(limit) ⇒ Object



88
89
90
91
92
# File 'lib/deep_test/agent.rb', line 88

def _dump(limit)
  Marshal.dump([@work_unit, @error], limit)
rescue
  Marshal.dump(["<< Undumpable >>", @error], limit)
end

#to_sObject



103
104
105
# File 'lib/deep_test/agent.rb', line 103

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