Module: Lite::Command::Internals::Results
- Defined in:
- lib/lite/command/internals/results.rb
Instance Method Summary collapse
- #outcome ⇒ Object
- #results ⇒ Object
- #to_hash ⇒ Object (also: #to_h)
Instance Method Details
#outcome ⇒ Object
8 9 10 11 12 |
# File 'lib/lite/command/internals/results.rb', line 8 def outcome return state if pending? || thrown? status end |
#results ⇒ Object
14 15 16 |
# File 'lib/lite/command/internals/results.rb', line 14 def results @results ||= context.results ||= [] end |
#to_hash ⇒ Object Also known as: to_h
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/lite/command/internals/results.rb', line 18 def to_hash { index:, cmd_id:, command: self.class.name, outcome:, state:, status:, reason:, metadata:, caused_by: caused_by&.index, caused_exception: Utils.pretty_exception(caused_by&.original_exception), thrown_by: thrown_by&.index, thrown_exception: Utils.pretty_exception(thrown_by&.command_exception), runtime: }.compact end |