Class: TotalIn::FileFormatValidator
- Inherits:
-
LineParser
- Object
- LineParser
- TotalIn::FileFormatValidator
- Defined in:
- lib/total_in/file_format_validator.rb
Instance Attribute Summary
Attributes inherited from LineParser
Instance Method Summary collapse
Methods inherited from LineParser
#attributes, field, #initialize
Constructor Details
This class inherits a constructor from TotalIn::LineParser
Instance Method Details
#errors ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/total_in/file_format_validator.rb', line 11 def errors errors = [] errors << "Must start with 00 (was ”#{record_type}”)" if record_type != "00" errors << "Must be of type TL1 (was ”#{file_type}”" if file_type != "TL1" errors end |
#valid? ⇒ Boolean
7 8 9 |
# File 'lib/total_in/file_format_validator.rb', line 7 def valid? errors.empty? end |