From: Mohit Sindhwani Date: 2008-03-01T22:19:53+09:00 Subject: Re: Getting number of days in a month Jari Williamsson wrote: >> If you look at the documentation for the Time class - >> http://www.ruby-doc.org/core/classes/Time.html >> it has the following: >> >> LeapYearMonthDays = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, >> 30, 31] >> CommonYearMonthDays = [31, 28, 31, 30, 31, 30, 31, 31, 30, >> 31, 30, 31] >> >> Why can't I access these constants directly? Perhaps, my Ruby >> knowledge is a bit lacking, but I guessed that if I could access >> that, I could have just used that :-S > > Those constants are declared private. > > > Best regards, > > Jari Williamsson Thanks Jari - that clears that up. I guess that means that if I add a function for 'number of days in a month' to the Time class, I could use these constants to serve up the number directly without any other calculation. Cheers, Mohit. 3/1/2008 | 9:20 PM.