Using inheritance in Ruby is extremely powerful and can greatly reduce complexity in your code. In this blog post, I show you how to dry up your code with Plain Ole' Ruby Objects (PORO's) that leverage inheritance.
Let's say we have an apartment listings website. Users can search for apartments in their area and refine the search with filters like # of bedrooms, max price, and lease start date.
User Chooses Number of Bedrooms (images courtesy of apartmentlist.com)