Module: Lite::Command::Internals::Resultable
- Defined in:
- lib/lite/command/internals/resultable.rb
Instance Method Summary collapse
Instance Method Details
#cid ⇒ Object
14 15 16 |
# File 'lib/lite/command/internals/resultable.rb', line 14 def cid @cid ||= context.cid end |
#index ⇒ Object
10 11 12 |
# File 'lib/lite/command/internals/resultable.rb', line 10 def index @index ||= context.index ||= 0 end |
#outcome ⇒ Object
18 19 20 21 22 |
# File 'lib/lite/command/internals/resultable.rb', line 18 def outcome return state if pending? || thrown? status end |
#results ⇒ Object
24 25 26 |
# File 'lib/lite/command/internals/resultable.rb', line 24 def results @results ||= context.results ||= [] end |
#to_hash ⇒ Object Also known as: to_h
28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/lite/command/internals/resultable.rb', line 28 def to_hash { index:, cid:, command: self.class.name, outcome:, state:, status:, reason:, caused_by: caused_by&.index, thrown_by: thrown_by&.index, runtime: }.compact end |