Class: FiletypeValidation::CsvValidator

Inherits:
BaseValidator show all
Defined in:
lib/filetype_validation/csv_validator.rb

Overview

aka Comma Separated Valuedator <— hahahahhahah

Constant Summary collapse

MAX_LINES =
25
HEADERS =
true

Instance Attribute Summary

Attributes inherited from BaseValidator

#file, #options

Instance Method Summary collapse

Methods inherited from BaseValidator

#initialize

Constructor Details

This class inherits a constructor from FiletypeValidation::BaseValidator

Instance Method Details

#valid?Boolean

Evaluates whether the file is a csv

Returns:

  • (Boolean)

    true if it’s a csv file



13
14
15
16
17
# File 'lib/filetype_validation/csv_validator.rb', line 13

def valid?
  csv_extension? &&
    FiletypeValidation.plaintext?(file, options) &&
    parse_csv?
end