From: Morton Goldberg Date: 2006-08-27T11:31:20+09:00 Subject: Re: [QUIZ] DayRange (#92) It certainly looks good to me. I believe the quiz master has indicated we have considerable latitude in what we admit as a valid argument sequence for DayRange#initialize. Allowing a set of day names to be specified when an instance of DayRange is created is a neat idea. I didn't think of that. Also, I decided not to allow lists such as [1,3,4,5,6,7] although my DayRange#initialize is pretty permissive in other ways. The closest I can get to what you show is: days = DayRange.new(1,3,4,5,6,7) puts days puts days.to_s(true) Mon, Wed-Sun Monday, Wednesday-Sunday As you can see, I do allow optional long-form English names for days to be returned from to_s. But your idea of allowing the programmer to specify the names at instance creation time is better. Regards, Morton On Aug 26, 2006, at 11:02 AM, Robert Retzbach wrote: > Thanks I was about to ask too. > > For the time being I made it this way: > > dayrange = DayRange.new [1,3,4,5,6,7], %w{Mo Di Mi Do Fr Sa So} > p dayrange.to_s #=> "Mo, Mi-So" > > I think that's the way it should work. If not, please tell me.