Class: Ibex::Runtime::RepairPlan
- Inherits:
-
Object
- Object
- Ibex::Runtime::RepairPlan
- Defined in:
- lib/json5/generated_parser.rb
Overview
Deterministically selected repair.
Instance Attribute Summary collapse
- #configurations ⇒ Object readonly
- #cost ⇒ Object readonly
- #edits ⇒ Object readonly
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.
4547 4548 4549 4550 4551 4552 4553 4554 |
# File 'lib/json5/generated_parser.rb', line 4547 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)
4544 4545 4546 |
# File 'lib/json5/generated_parser.rb', line 4544 def configurations @configurations end |
#cost ⇒ Object (readonly)
4543 4544 4545 |
# File 'lib/json5/generated_parser.rb', line 4543 def cost @cost end |
#edits ⇒ Object (readonly)
4542 4543 4544 |
# File 'lib/json5/generated_parser.rb', line 4542 def edits @edits end |
Instance Method Details
#to_h ⇒ Object
4557 4558 4559 |
# File 'lib/json5/generated_parser.rb', line 4557 def to_h { cost: @cost, configurations: @configurations, edits: @edits.map(&:to_h).freeze }.freeze end |