First, I created a DinosaurDinosaur class. Most of the attributes are readable (except for the @period@period instance variable). I've created a custom Dinosaur#to_sDinosaur#to_s method in order to print the dinosaur object. I've also created Dinosaur#carnivorousDinosaur#carnivorous, Dinosaur#bigDinosaur#big, and Dinosaur#smallDinosaur#small. These methods return Booleans, but I didn't name them with an ending "?" for reasons that might be clear in the implementation of the filter method.
Secondly, I created a DinodexDinodex class. This class holds DinosaurDinosaur objects in an array. Because the internal data structure is an array, I've defined Dinodex#<<(Dinosaur)Dinodex#<<(Dinosaur). Dinodex#to_sDinodex#to_s merely aggregates the strings returned calls to Dinosaur#to_sDinosaur#to_s, for all the dinosaurs in the dinodex.
The interesting part about the Dinodex Dinodex (or at least the one I had the most trouble with), is the Dinodex#filter methodDinodex#filter method. The Dinodex#filterDinodex#filter method takes an options hash, where (ideally) the keys are attributes of the DinosaurDinosaur class, and the values are what the user is selecting for.
NOTE: I am just realizing now that I am writing this out that the else branch in the Dinodex#filterDinodex#filter method that I should check if param is valid. I would do this by using the respond_to?(param) method.
I had a tough time figuring out how to make the Dinodex#filtersDinodex#filters method recursive, until I realized I can just update what the local variable selection points to. Once the right dinosaurs have been selected, a new DinodexDinodex object is returned, so that chaining is possible.