Representing Tabular Data in Ruby - A Mini E-Book
Mendicant University (MU) regularly releases the programming assignments used in its three-week Ruby software development courses. In addition to publicizing the assignments, students who took the course often open up their solutions. So anyone interested in getting better at Ruby can use this material for self-study.
To increase the educational value of this material, Felipe Doria and I decided to create a "digest" of one of the exercises. It eventually grew into something the size of a mini E-Book, mainly because of the large number of code samples.
The assignment we picked was about building a general purpose table structure that could be used in a wide range of data processing scenarios. In the E-Booklet we outline step by step the process taken to arrive at the final solution, stopping along the way to explain the reasoning behind the various design decisions.
The concepts covered include:
- TDD approach to a complex problem
- Modeling tabular data (rows, columns, cells)
- Efficiently handling exceptions and bad user input
- API design in line with the Single Responsibility Principle
- Mixing in core modules like Enumerable
You can download the E-Book in PDF format.