Class: Uniword::Batch::Operation::FileResult
- Inherits:
-
Object
- Object
- Uniword::Batch::Operation::FileResult
- Defined in:
- lib/uniword/batch/operation/file_result.rb
Overview
Aggregated result for one file in a batch run.
Instance Attribute Summary collapse
-
#error ⇒ String?
readonly
Error message when status is :failure.
-
#metric ⇒ Integer
readonly
Operation-specific metric (e.g. repair count, verify issue count).
-
#path ⇒ String
readonly
Absolute or relative path of the input file.
-
#status ⇒ Symbol
readonly
:success, :failure.
Instance Method Summary collapse
-
#initialize(path:, status:, metric: 0, error: nil) ⇒ FileResult
constructor
A new instance of FileResult.
- #success? ⇒ Boolean
Constructor Details
#initialize(path:, status:, metric: 0, error: nil) ⇒ FileResult
Returns a new instance of FileResult.
25 26 27 28 29 30 |
# File 'lib/uniword/batch/operation/file_result.rb', line 25 def initialize(path:, status:, metric: 0, error: nil) @path = path @status = status @metric = metric @error = error end |
Instance Attribute Details
#error ⇒ String? (readonly)
Returns error message when status is :failure.
19 20 21 |
# File 'lib/uniword/batch/operation/file_result.rb', line 19 def error @error end |
#metric ⇒ Integer (readonly)
Returns operation-specific metric (e.g. repair count, verify issue count).
16 17 18 |
# File 'lib/uniword/batch/operation/file_result.rb', line 16 def metric @metric end |
#path ⇒ String (readonly)
Returns absolute or relative path of the input file.
9 10 11 |
# File 'lib/uniword/batch/operation/file_result.rb', line 9 def path @path end |
#status ⇒ Symbol (readonly)
Returns :success, :failure.
12 13 14 |
# File 'lib/uniword/batch/operation/file_result.rb', line 12 def status @status end |
Instance Method Details
#success? ⇒ Boolean
33 34 35 |
# File 'lib/uniword/batch/operation/file_result.rb', line 33 def success? @status == :success end |