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.
Okay.

*Jeremy Finzel*

*Senior Database Developer*
*M* 630-777-4520




On Tue, Dec 16, 2014 at 8:26 PM, Joseph Mastey <notifications@github.com>
wrote:
>
> In dino_catalog/dinosaur_info.rb
> <https://github.com/jmmastey/level_up_exercises/pull/350#discussion-diff-21949074>
> :
>
> > +
> > +  # options should be in the following format
> > +  # { operator <string> => { attribute: value } }
> > +  def filter_dinosaurs(options = {})
> > +    @dinosaurs_filtered = @dinosaurs
> > +    @filters = options
> > +    options.each do |operator, filters|
> > +      filters.each do |key, value|
> > +        @dinosaurs_filtered =
> > +            @dinosaurs_filtered.select do |dinosaur|
> > +              dinosaur.send("#{key}").send(operator, value)
> > +            end
> > +      end
> > +    end
> > +    @dinosaurs_filtered
> > +  end
>
> This is too complicated as a method. Refactor into some smaller methods.
> Also, this is still too many instance vars. Send some params.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/jmmastey/level_up_exercises/pull/350/files#r21949074>.
>