Please Forward-Ruby Quiz Submission #92

From: afalcone@tinymonkey.net
Date: August 29, 2006 12:21:02 PM CDT
To: submission@rubyquiz.com
Subject: Please Forward-Ruby Quiz Submission #92

to_s shouldn't be figuring out the string representation every time it's
run. It makes more sense to run that code whenever the object itself
changes. That's what I've done in this version.

Come to think of it... the even lazier approach would be to wait to
compute the string on the first run of to_s, and have every subsequent
call to to_s return a instance variable, unless the object is changed.

-A

dayRange.rb (2.05 KB)

ยทยทยท

Begin forwarded message: