Class: Aidp::Execute::DeterministicUnits::Result

Inherits:
Object
  • Object
show all
Defined in:
lib/aidp/execute/deterministic_unit.rb

Overview

Result wrapper returned after executing a deterministic unit.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, status:, output_path:, started_at:, finished_at:, data: {}, error: nil) ⇒ Result

Returns a new instance of Result.



91
92
93
94
95
96
97
98
99
100
# File 'lib/aidp/execute/deterministic_unit.rb', line 91

def initialize(name:, status:, output_path:, started_at:, finished_at:, data: {}, error: nil)
  @name = name
  @status = status.to_sym
  @output_path = output_path
  @started_at = started_at
  @finished_at = finished_at
  @duration = finished_at - started_at
  @data = data
  @error = error
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



88
89
90
# File 'lib/aidp/execute/deterministic_unit.rb', line 88

def data
  @data
end

#durationObject (readonly)

Returns the value of attribute duration.



88
89
90
# File 'lib/aidp/execute/deterministic_unit.rb', line 88

def duration
  @duration
end

#errorObject (readonly)

Returns the value of attribute error.



88
89
90
# File 'lib/aidp/execute/deterministic_unit.rb', line 88

def error
  @error
end

#finished_atObject (readonly)

Returns the value of attribute finished_at.



88
89
90
# File 'lib/aidp/execute/deterministic_unit.rb', line 88

def finished_at
  @finished_at
end

#nameObject (readonly)

Returns the value of attribute name.



88
89
90
# File 'lib/aidp/execute/deterministic_unit.rb', line 88

def name
  @name
end

#output_pathObject (readonly)

Returns the value of attribute output_path.



88
89
90
# File 'lib/aidp/execute/deterministic_unit.rb', line 88

def output_path
  @output_path
end

#started_atObject (readonly)

Returns the value of attribute started_at.



88
89
90
# File 'lib/aidp/execute/deterministic_unit.rb', line 88

def started_at
  @started_at
end

#statusObject (readonly)

Returns the value of attribute status.



88
89
90
# File 'lib/aidp/execute/deterministic_unit.rb', line 88

def status
  @status
end

Instance Method Details

#failure?Boolean

Returns:

  • (Boolean)


106
107
108
# File 'lib/aidp/execute/deterministic_unit.rb', line 106

def failure?
  status == :failure
end

#success?Boolean

Returns:

  • (Boolean)


102
103
104
# File 'lib/aidp/execute/deterministic_unit.rb', line 102

def success?
  status == :success
end

#timeout?Boolean

Returns:

  • (Boolean)


110
111
112
# File 'lib/aidp/execute/deterministic_unit.rb', line 110

def timeout?
  status == :timeout
end