Class: Ibex::Runtime::RepairSearchResult
- Inherits:
-
Object
- Object
- Ibex::Runtime::RepairSearchResult
- Defined in:
- lib/ibex/runtime/repair.rb,
sig/ibex/runtime/repair.rbs
Overview
Closed internal outcome for callers that must distinguish bounded search exhaustion from a complete search with no repair.
Constant Summary collapse
- STATUSES =
%i[selected need_input exhausted not_found].freeze
Instance Attribute Summary collapse
- #configurations ⇒ Integer readonly
- #plan ⇒ RepairPlan? readonly
- #status ⇒ Symbol readonly
Instance Method Summary collapse
-
#initialize(status:, plan:, configurations:) ⇒ RepairSearchResult
constructor
A new instance of RepairSearchResult.
- #selected? ⇒ Boolean
Constructor Details
#initialize(status:, plan:, configurations:) ⇒ RepairSearchResult
Returns a new instance of RepairSearchResult.
105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
# File 'lib/ibex/runtime/repair.rb', line 105 def initialize(status:, plan:, configurations:) raise ArgumentError, "unknown repair search status #{status.inspect}" unless STATUSES.include?(status) unless configurations.is_a?(Integer) && configurations >= 0 raise ArgumentError, "repair search configurations must be nonnegative" end unless (status == :selected) == plan.is_a?(RepairPlan) raise ArgumentError, "selected repair search status and plan must agree" end @status = status @plan = plan @configurations = configurations freeze end |
Instance Attribute Details
#configurations ⇒ Integer (readonly)
102 103 104 |
# File 'lib/ibex/runtime/repair.rb', line 102 def configurations @configurations end |
#plan ⇒ RepairPlan? (readonly)
101 102 103 |
# File 'lib/ibex/runtime/repair.rb', line 101 def plan @plan end |
#status ⇒ Symbol (readonly)
100 101 102 |
# File 'lib/ibex/runtime/repair.rb', line 100 def status @status end |
Instance Method Details
#selected? ⇒ Boolean
121 |
# File 'lib/ibex/runtime/repair.rb', line 121 def selected? = @status == :selected |