Exploring Ruby class methods

February 15th, 2008

I decided that I needed to learn more about all the different ways to declare and use Ruby class methods, so I wrote a 10-line example script to try a couple things out. Two hours later, it had expanded to almost 300 lines (including lots of comments) as I tried to demonstrate and explain every way that I could think of to declare and use class methods.

Take a look, download the code, open it in your editor, and run it (Apple-R in TextMate). Mess around with it.

Did I miss anything? Did I get anything wrong? Post your comments and questions in the comments below.

Comments are closed.