Class: Ibex::Runtime::RepairPlan
- Inherits:
-
Object
- Object
- Ibex::Runtime::RepairPlan
- Defined in:
- lib/ibex/runtime/repair.rb
Overview
Deterministically selected repair.
Instance Attribute Summary collapse
-
#configurations ⇒ Object
readonly
: Integer.
-
#cost ⇒ Object
readonly
: Integer.
-
#edits ⇒ Object
readonly
: Array.
Instance Method Summary collapse
-
#initialize(edits:, configurations:) ⇒ RepairPlan
constructor
A new instance of RepairPlan.
- #to_h ⇒ Object
Constructor Details
#initialize(edits:, configurations:) ⇒ RepairPlan
Returns a new instance of RepairPlan.
80 81 82 83 84 85 86 87 |
# File 'lib/ibex/runtime/repair.rb', line 80 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 ⇒ Object (readonly)
: Integer
77 78 79 |
# File 'lib/ibex/runtime/repair.rb', line 77 def configurations @configurations end |
#cost ⇒ Object (readonly)
: Integer
76 77 78 |
# File 'lib/ibex/runtime/repair.rb', line 76 def cost @cost end |
#edits ⇒ Object (readonly)
: Array
75 76 77 |
# File 'lib/ibex/runtime/repair.rb', line 75 def edits @edits end |
Instance Method Details
#to_h ⇒ Object
90 91 92 |
# File 'lib/ibex/runtime/repair.rb', line 90 def to_h { cost: @cost, configurations: @configurations, edits: @edits.map(&:to_h).freeze }.freeze end |