Class: Kaisoku::Evaluator::CommandResult
- Inherits:
-
Object
- Object
- Kaisoku::Evaluator::CommandResult
- Defined in:
- lib/kaisoku/evaluator/command_result.rb
Instance Attribute Summary collapse
-
#output ⇒ Object
readonly
Returns the value of attribute output.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#time ⇒ Object
readonly
Returns the value of attribute time.
Instance Method Summary collapse
- #executed_ids ⇒ Object
- #failed_ids ⇒ Object
- #fallback? ⇒ Boolean
-
#initialize(status:, time:, output:) ⇒ CommandResult
constructor
A new instance of CommandResult.
- #selected_count ⇒ Object
- #selection ⇒ Object
- #total_count ⇒ Object
Constructor Details
#initialize(status:, time:, output:) ⇒ CommandResult
Returns a new instance of CommandResult.
10 11 12 13 14 |
# File 'lib/kaisoku/evaluator/command_result.rb', line 10 def initialize(status:, time:, output:) @status = status @time = time @output = output end |
Instance Attribute Details
#output ⇒ Object (readonly)
Returns the value of attribute output.
8 9 10 |
# File 'lib/kaisoku/evaluator/command_result.rb', line 8 def output @output end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
8 9 10 |
# File 'lib/kaisoku/evaluator/command_result.rb', line 8 def status @status end |
#time ⇒ Object (readonly)
Returns the value of attribute time.
8 9 10 |
# File 'lib/kaisoku/evaluator/command_result.rb', line 8 def time @time end |
Instance Method Details
#executed_ids ⇒ Object
20 21 22 |
# File 'lib/kaisoku/evaluator/command_result.rb', line 20 def executed_ids results.keys end |
#failed_ids ⇒ Object
16 17 18 |
# File 'lib/kaisoku/evaluator/command_result.rb', line 16 def failed_ids results.select { |_id, payload| failed_payload?(payload) }.keys end |
#fallback? ⇒ Boolean
36 37 38 |
# File 'lib/kaisoku/evaluator/command_result.rb', line 36 def fallback? selection['fallback'] || output.include?('fallback') end |
#selected_count ⇒ Object
24 25 26 |
# File 'lib/kaisoku/evaluator/command_result.rb', line 24 def selected_count selection['selected'] end |
#selection ⇒ Object
32 33 34 |
# File 'lib/kaisoku/evaluator/command_result.rb', line 32 def selection parsed.fetch('selection', {}) end |
#total_count ⇒ Object
28 29 30 |
# File 'lib/kaisoku/evaluator/command_result.rb', line 28 def total_count selection['total'] end |