First Dino Dex Program

I have it set up right now to just run the code in the Main class, and it prints the results to the console.
That makes sense, but I think I need to understand more about when a method
should be a class method vs. an instance method.  My thinking is that if a
method does not necessarily deal with instance variables, it should be a
class method, but what are your thoughts on that?

*Jeremy Finzel*

*Senior Database Developer*
*M* 630-777-4520




On Tue, Dec 16, 2014 at 8:22 PM, Joseph Mastey <notifications@github.com>
wrote:
>
> In dino_catalog/dinosaur_import.rb
> <https://github.com/jmmastey/level_up_exercises/pull/350#discussion-diff-21948976>
> :
>
> > +      @data = CSV.read(csv_file, DEFAULT_OPTIONS)
> > +      dinosaurs_from_file = data_to_dinosaurs
> > +      dinosaurs.concat(dinosaurs_from_file)
> > +    end
> > +    @dinosaurs = dinosaurs
> > +  end
> > +
> > +  def data_to_dinosaurs
> > +    dinosaurs = []
> > +    @data.each do |row|
> > +      hash = row.to_hash
> > +      hash = self.class.convert_import_hash(hash)
> > +      dinosaurs << Dinosaur.new(hash)
> > +    end
> > +    dinosaurs
> > +  end
>
> That said, self.class.convert_import_hash is needlessly odd. Just make it
> a private instance method.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/jmmastey/level_up_exercises/pull/350/files#r21948976>.
>