Class: AgentCliRuntime::TerminationEvidence
- Inherits:
-
Data
- Object
- Data
- AgentCliRuntime::TerminationEvidence
- Defined in:
- lib/agent_cli_runtime/values.rb
Instance Attribute Summary collapse
-
#cancelled ⇒ Object
readonly
Returns the value of attribute cancelled.
-
#exit_code ⇒ Object
readonly
Returns the value of attribute exit_code.
-
#signal ⇒ Object
readonly
Returns the value of attribute signal.
-
#timed_out ⇒ Object
readonly
Returns the value of attribute timed_out.
Instance Method Summary collapse
-
#initialize(exit_code:, timed_out: false, cancelled: false, signal: nil) ⇒ TerminationEvidence
constructor
A new instance of TerminationEvidence.
- #success? ⇒ Boolean
Constructor Details
#initialize(exit_code:, timed_out: false, cancelled: false, signal: nil) ⇒ TerminationEvidence
Returns a new instance of TerminationEvidence.
411 412 413 414 415 416 417 418 419 420 421 422 |
# File 'lib/agent_cli_runtime/values.rb', line 411 def initialize(exit_code:, timed_out: false, cancelled: false, signal: nil) unless exit_code.nil? || exit_code.is_a?(Integer) raise ArgumentError, "exit_code must be an Integer or nil" end super( exit_code: exit_code, timed_out: timed_out == true, cancelled: cancelled == true, signal: signal.nil? ? nil : Immutable.string(signal) ) end |
Instance Attribute Details
#cancelled ⇒ Object (readonly)
Returns the value of attribute cancelled
408 409 410 |
# File 'lib/agent_cli_runtime/values.rb', line 408 def cancelled @cancelled end |
#exit_code ⇒ Object (readonly)
Returns the value of attribute exit_code
408 409 410 |
# File 'lib/agent_cli_runtime/values.rb', line 408 def exit_code @exit_code end |
#signal ⇒ Object (readonly)
Returns the value of attribute signal
408 409 410 |
# File 'lib/agent_cli_runtime/values.rb', line 408 def signal @signal end |
#timed_out ⇒ Object (readonly)
Returns the value of attribute timed_out
408 409 410 |
# File 'lib/agent_cli_runtime/values.rb', line 408 def timed_out @timed_out end |
Instance Method Details
#success? ⇒ Boolean
424 425 426 |
# File 'lib/agent_cli_runtime/values.rb', line 424 def success? !timed_out && !cancelled && signal.nil? && exit_code == 0 end |