Module: Csv2hash::StructureValidator::Validator

Included in:
MaxColumns, MinColumns
Defined in:
lib/csv2hash/structure_validator.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) validate!(source)



36
37
38
39
40
41
# File 'lib/csv2hash/structure_validator.rb', line 36

def validate! source
  source.index { |line| validate_line line }.tap do |line|
    raise ValidationError, error_message(line) unless line.nil?
  end
  true
end