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