Class: Norma43::LineParsers::FileFormatValidator
- Inherits:
-
LineParser
- Object
- LineParser
- Norma43::LineParsers::FileFormatValidator
show all
- Defined in:
- lib/norma43/line_parsers/file_format_validator.rb
Instance Attribute Summary
Attributes inherited from LineParser
#line
Instance Method Summary
collapse
Methods inherited from LineParser
#attributes, field, #initialize
Instance Method Details
#errors ⇒ Object
15
16
17
18
19
|
# File 'lib/norma43/line_parsers/file_format_validator.rb', line 15
def errors
errors = []
%w(11 00).include?(record_type) || errors << ("Must start with 00 (was ”#{record_type}”)")
errors
end
|
#has_document? ⇒ Boolean
9
|
# File 'lib/norma43/line_parsers/file_format_validator.rb', line 9
def has_document?; file_type == "00" end
|
#valid? ⇒ Boolean
11
12
13
|
# File 'lib/norma43/line_parsers/file_format_validator.rb', line 11
def valid?
errors.empty?
end
|