Class: Csv2hash::StructureValidator::MaxColumns
- Inherits:
-
Object
- Object
- Csv2hash::StructureValidator::MaxColumns
- Includes:
- Validator
- Defined in:
- lib/csv2hash/structure_validator/max_columns.rb
Instance Method Summary (collapse)
- - (Object) error_message(line)
-
- (MaxColumns) initialize(max_size)
constructor
A new instance of MaxColumns.
- - (Object) validate_line(line)
Methods included from Validator
Constructor Details
- (MaxColumns) initialize(max_size)
Returns a new instance of MaxColumns
7 8 9 |
# File 'lib/csv2hash/structure_validator/max_columns.rb', line 7 def initialize max_size @max_size = max_size end |
Instance Method Details
- (Object) error_message(line)
15 16 17 |
# File 'lib/csv2hash/structure_validator/max_columns.rb', line 15 def line "Too many columns (max. #{@max_size}) on line #{line}" end |
- (Object) validate_line(line)
11 12 13 |
# File 'lib/csv2hash/structure_validator/max_columns.rb', line 11 def validate_line line line.size > @max_size end |