Class: Uniword::Docx::Reconciler::Fix
- Inherits:
-
Object
- Object
- Uniword::Docx::Reconciler::Fix
- Defined in:
- lib/uniword/docx/reconciler/fix.rb
Overview
A single repair applied by the Reconciler during save.
Immutable value object exposed as the reconciliation report via
Package#applied_fixes after a save. The Reconciler stays the only
mutating pass; this report is a by-product value, not a global.
Instance Attribute Summary collapse
-
#code ⇒ String
readonly
Fix code (see Reconciler::FixCodes).
-
#message ⇒ String
readonly
Human-readable description of the repair.
-
#part ⇒ String?
readonly
Package part the repair applies to.
Instance Method Summary collapse
-
#initialize(code:, message:, part: nil) ⇒ Fix
constructor
Create a fix record.
-
#to_s ⇒ String
Compact single-line representation.
Constructor Details
#initialize(code:, message:, part: nil) ⇒ Fix
Create a fix record.
32 33 34 35 36 |
# File 'lib/uniword/docx/reconciler/fix.rb', line 32 def initialize(code:, message:, part: nil) @code = code @message = @part = part end |
Instance Attribute Details
#code ⇒ String (readonly)
Returns Fix code (see Reconciler::FixCodes).
19 20 21 |
# File 'lib/uniword/docx/reconciler/fix.rb', line 19 def code @code end |
#message ⇒ String (readonly)
Returns Human-readable description of the repair.
22 23 24 |
# File 'lib/uniword/docx/reconciler/fix.rb', line 22 def @message end |
#part ⇒ String? (readonly)
Returns Package part the repair applies to.
25 26 27 |
# File 'lib/uniword/docx/reconciler/fix.rb', line 25 def part @part end |
Instance Method Details
#to_s ⇒ String
Returns Compact single-line representation.
39 40 41 42 |
# File 'lib/uniword/docx/reconciler/fix.rb', line 39 def to_s location = part ? " [#{part}]" : "" "#{code}#{location}: #{}" end |