Class: Mxrb::Integrity::Validator
- Inherits:
-
Object
- Object
- Mxrb::Integrity::Validator
- Defined in:
- lib/mxrb/integrity/validator.rb
Instance Method Summary collapse
-
#initialize(path) ⇒ Validator
constructor
A new instance of Validator.
- #validate ⇒ Object
Constructor Details
#initialize(path) ⇒ Validator
Returns a new instance of Validator.
12 13 14 |
# File 'lib/mxrb/integrity/validator.rb', line 12 def initialize(path) @path = path end |
Instance Method Details
#validate ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/mxrb/integrity/validator.rb', line 16 def validate @errors = [] @warnings = [] @mpr = IO::MprFile.open(@path, readonly: true) validate_tables validate_units validate_v2_files Result.new(errors: @errors, warnings: @warnings) rescue Error => e Result.new(errors: [e.], warnings: @warnings || []) ensure @mpr&.close end |