Class: Parser
- Inherits:
-
Object
- Object
- Parser
- Defined in:
- lib/common_tools/parser.rb
Class Method Summary collapse
Class Method Details
.build_batch(file) ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/common_tools/parser.rb', line 8 def self.build_batch(file) headers = CSV.read(file, headers: true).headers Student.build_attributes(headers) CSV.foreach(file, headers: true).map do |row| make_student_attributes(row) unless row[0] == "first_name" || row[0].nil? end.to_json end |