Summary

Our objective for today was to learn how to make a class easy to use. IntegerMatrix turns out to have quite a lot of functionality, and perhaps we can't convincingly say we succeeded in keeping its interface small. But we did make it quite intuitive, so that a user would be able to do a lot of things right the first time even when guessing. Our constructor does a good job of setting up each new matrix based on the supplied information; the basic mathematical operators all seem to do what they should; to_s and inspect make it easy for the user to see what each IntegerMatrix object is made of.

We're in Week 3 now, the home stretch. Tomorrow is to be the first of two “putting it together” sessions; that means that rather than introduce new ...

Get Sams Teach Yourself Ruby in 21 Days now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.