DinoDex 9/8/2014

Another noob mistake at the time, wasn't really sure how to go about
this... I can't remember exactly but I was getting different responses, or
something based on the search method... maybe? ... or in Sri's words I was
trying to be "TOO meta"

On Mon, Sep 8, 2014 at 7:53 PM, Joseph Mastey <notifications@github.com>
wrote:

> In dino_catalog/search_catalog.rb:
>
> > +  def search(catalog, terms)
> > +    search_catalog  = catalog.dup
> > +    catalog_options = get_options(terms)
> > +    unless catalog_options.empty?
> > +      catalog_options.each do |option|
> > +        case option
> > +        when Array
> > +          option.each do |opt|
> > +            case opt
> > +            when Symbol
> > +              search_catalog = method(opt).call(search_catalog)
> > +            else
> > +              search_catalog = search_text(search_catalog, opt)
> > +            end
> > +          end
> > +        when Hash
>
> gruhhhh case. nested case? c'mon man... just use Array(catalog_options)
> or some other coercion. There's no way to read this thing.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/jmmastey/level_up_exercises/pull/30/files#r17276896>.
>