Class: Ast::Merge::Ruleset::RepairPolicy
- Inherits:
-
Object
- Object
- Ast::Merge::Ruleset::RepairPolicy
- Defined in:
- lib/ast/merge/ruleset/repair_policy.rb
Overview
Declarative handling policy for a named ambiguous/corruption-class seam.
Instance Attribute Summary collapse
-
#handling ⇒ Object
readonly
Returns the value of attribute handling.
-
#kind ⇒ Object
readonly
Returns the value of attribute kind.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
Instance Method Summary collapse
-
#initialize(kind:, handling:, metadata: {}) ⇒ RepairPolicy
constructor
A new instance of RepairPolicy.
- #to_h ⇒ Object
Constructor Details
#initialize(kind:, handling:, metadata: {}) ⇒ RepairPolicy
Returns a new instance of RepairPolicy.
10 11 12 13 14 |
# File 'lib/ast/merge/ruleset/repair_policy.rb', line 10 def initialize(kind:, handling:, metadata: {}) @kind = kind&.to_sym @handling = Ast::Merge::Healer.normalize_mode(handling) @metadata = .dup.freeze end |
Instance Attribute Details
#handling ⇒ Object (readonly)
Returns the value of attribute handling.
8 9 10 |
# File 'lib/ast/merge/ruleset/repair_policy.rb', line 8 def handling @handling end |
#kind ⇒ Object (readonly)
Returns the value of attribute kind.
8 9 10 |
# File 'lib/ast/merge/ruleset/repair_policy.rb', line 8 def kind @kind end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
8 9 10 |
# File 'lib/ast/merge/ruleset/repair_policy.rb', line 8 def @metadata end |
Instance Method Details
#to_h ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/ast/merge/ruleset/repair_policy.rb', line 16 def to_h { kind: kind, handling: handling, metadata: }.compact end |