Class: Ibex::Runtime::RepairPlan
- Inherits:
-
Object
- Object
- Ibex::Runtime::RepairPlan
- Defined in:
- lib/ibex/runtime/repair.rb,
sig/ibex/runtime/repair.rbs
Overview
Deterministically selected repair.
Instance Attribute Summary collapse
- #configurations ⇒ Integer readonly
- #cost ⇒ Integer readonly
- #edits ⇒ Array[RepairEdit] readonly
Instance Method Summary collapse
-
#initialize(edits:, configurations:) ⇒ RepairPlan
constructor
A new instance of RepairPlan.
- #to_h ⇒ Hash[Symbol, untyped]
Constructor Details
#initialize(edits:, configurations:) ⇒ RepairPlan
Returns a new instance of RepairPlan.
78 79 80 81 82 83 84 85 |
# File 'lib/ibex/runtime/repair.rb', line 78 def initialize(edits:, configurations:) raise ArgumentError, "repair plan must contain an edit" if edits.empty? @edits = edits.dup.freeze @cost = @edits.sum(&:cost) @configurations = configurations freeze end |
Instance Attribute Details
#configurations ⇒ Integer (readonly)
75 76 77 |
# File 'lib/ibex/runtime/repair.rb', line 75 def configurations @configurations end |
#cost ⇒ Integer (readonly)
74 75 76 |
# File 'lib/ibex/runtime/repair.rb', line 74 def cost @cost end |
#edits ⇒ Array[RepairEdit] (readonly)
73 74 75 |
# File 'lib/ibex/runtime/repair.rb', line 73 def edits @edits end |
Instance Method Details
#to_h ⇒ Hash[Symbol, untyped]
88 89 90 |
# File 'lib/ibex/runtime/repair.rb', line 88 def to_h { cost: @cost, configurations: @configurations, edits: @edits.map(&:to_h).freeze }.freeze end |