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.
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 ⇒ Object (readonly)
: Integer
75 76 77 |
# File 'lib/ibex/runtime/repair.rb', line 75 def configurations @configurations end |
#cost ⇒ Object (readonly)
: Integer
74 75 76 |
# File 'lib/ibex/runtime/repair.rb', line 74 def cost @cost end |
#edits ⇒ Object (readonly)
: Array
73 74 75 |
# File 'lib/ibex/runtime/repair.rb', line 73 def edits @edits end |
Instance Method Details
#to_h ⇒ Object
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 |