Class: LittleGhost::CodeMode::ProgramResult
- Inherits:
-
Data
- Object
- Data
- LittleGhost::CodeMode::ProgramResult
- Defined in:
- lib/little_ghost/code_mode/types.rb,
lib/little_ghost/code_mode/types.rb
Overview
Describes one observation of a code-mode program. Its output contains text produced since the previous observation.
value carries the completed program's language value when the engine
supports one. status is :completed, :still_working, :terminated,
or :error. error contains a model-program error; lifecycle and cleanup
failures raise instead.
Instance Attribute Summary collapse
-
#artifacts ⇒ Object
readonly
Returns the value of attribute artifacts.
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#output ⇒ Object
readonly
Returns the value of attribute output.
-
#presentation_content ⇒ Object
readonly
Returns the value of attribute presentation_content.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#completed? ⇒ Boolean
Whether the program completed successfully.
-
#initialize(output: "", value: nil, status: :completed, error: nil, artifacts: [], presentation_content: []) ⇒ ProgramResult
constructor
Creates a program observation with empty output and a successful status by default.
-
#still_working? ⇒ Boolean
Whether the program remains active after this observation.
Constructor Details
#initialize(output: "", value: nil, status: :completed, error: nil, artifacts: [], presentation_content: []) ⇒ ProgramResult
Creates a program observation with empty output and a successful status by default.
35 36 37 38 39 40 41 42 43 44 |
# File 'lib/little_ghost/code_mode/types.rb', line 35 def initialize(output: "", value: nil, status: :completed, error: nil, artifacts: [], presentation_content: []) super( output:, value:, status:, error:, artifacts: Array(artifacts).dup.freeze, presentation_content: Array(presentation_content).dup.freeze ) end |
Instance Attribute Details
#artifacts ⇒ Object (readonly)
Returns the value of attribute artifacts
7 8 9 |
# File 'lib/little_ghost/code_mode/types.rb', line 7 def artifacts @artifacts end |
#error ⇒ Object (readonly)
Returns the value of attribute error
7 8 9 |
# File 'lib/little_ghost/code_mode/types.rb', line 7 def error @error end |
#output ⇒ Object (readonly)
Returns the value of attribute output
7 8 9 |
# File 'lib/little_ghost/code_mode/types.rb', line 7 def output @output end |
#presentation_content ⇒ Object (readonly)
Returns the value of attribute presentation_content
7 8 9 |
# File 'lib/little_ghost/code_mode/types.rb', line 7 def presentation_content @presentation_content end |
#status ⇒ Object (readonly)
Returns the value of attribute status
7 8 9 |
# File 'lib/little_ghost/code_mode/types.rb', line 7 def status @status end |
#value ⇒ Object (readonly)
Returns the value of attribute value
7 8 9 |
# File 'lib/little_ghost/code_mode/types.rb', line 7 def value @value end |
Instance Method Details
#completed? ⇒ Boolean
Whether the program completed successfully.
47 |
# File 'lib/little_ghost/code_mode/types.rb', line 47 def completed? = status == :completed |
#still_working? ⇒ Boolean
Whether the program remains active after this observation.
50 |
# File 'lib/little_ghost/code_mode/types.rb', line 50 def still_working? = status == :still_working |