Dino Dex First Refactor

Let me know when you have a few minutes.  I want to go over a few of the questions you had which I haven't yet done anything with.
Your 'map' comments are exactly what I've been looking for.  I knew there
had to be a better way to do that but I couldn't find what I needed easily.

*Jeremy Finzel*

*Senior Database Developer*
*M* 630-777-4520




On Thu, Dec 18, 2014 at 1:42 PM, zsyed1 <notifications@github.com> wrote:
>
> In dino_catalog/dinosaur_import.rb
> <https://github.com/jmmastey/level_up_exercises/pull/353#discussion-diff-22065950>
> :
>
> > +      data = CSV.read(csv_file, DEFAULT_OPTIONS)
> > +      dinosaurs_from_file = data_to_dinosaurs(data)
> > +      dinosaurs.concat(dinosaurs_from_file)
> > +    end
> > +    @dinosaurs = dinosaurs
> > +  end
> > +
> > +  def data_to_dinosaurs(data)
> > +    dinosaurs = []
> > +    data.each do |row|
> > +      hash = row.to_hash
> > +      hash = convert_import_hash(hash)
> > +      dinosaurs << Dinosaur.new(hash)
> > +    end
> > +    dinosaurs
> > +end
>
> Use map here. it will remove the need for initializing and returning
> dinosaurs.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/jmmastey/level_up_exercises/pull/353/files#r22065950>.
>