Class: Parser

Inherits:
Object
  • Object
show all
Defined in:
lib/work_together/parser.rb

Class Method Summary collapse

Class Method Details

.make_student_attributes(row) ⇒ Object



12
13
14
15
16
# File 'lib/work_together/parser.rb', line 12

def self.make_student_attributes(row)
  name = "#{row[0]} #{row[1]}"
  progress = row[5]
  Student.new(name, progress)
end

.parse_and_make_students(file) ⇒ Object



5
6
7
8
9
10
# File 'lib/work_together/parser.rb', line 5

def self.parse_and_make_students(file)
  CSV.foreach(file) do |row|
    make_student_attributes(row) unless row[0] == "first_name" || row[0].nil?
  end
  binding.pry
end