#!/usr/bin/env ruby
# Partie 2: Créations d'objets lus d'un fichier CSV

require "./meta1"

def csvinit(filename)
  # TODO
  # Hint1: Object.const_get("Foo") # --> la classe Foo
  # Hint2: File.readlines("filename") # --> un tableau avec chaque ligne de `filename`
  # Hint3: "hello_world".capitalize # --> "HelloWorld"
  # Hint4: File.basename("path/nom.txt", ".txt") # --> "nom"
end

if __FILE__ == $0
  # Exemple
  ps = csvinit("personne.csv")
  p ps # --> [#<Personne:0x00561670616de0 @prenom="Jon", @nom="Snow">, #<Personne:0x00561670616cc8 @prenom="Daenerys", @nom="Targaryen">]
  p ps.first.nom # --> "Snow"
end
