Yukihiro Matsumoto wrote:

> Hi,
>
> In message "[ruby-talk:15840] Re: subclassing Date"
>     on 01/05/28, Michael Husmann <Michael.Husmann / teleatlas.com> writes:
>
> |Could you look at it again? Thank you,
>
> You're defining an instance method new3.  I think you have to define a
> class method, for example:
>
>   class My_date < Date
>       def My_date.new(st)
>           l = st.split(".")
>         p l
>           y, m, d = l.collect{|s| s.to_i}
>           printf("year: %d, month: %d, day: %d\n", y, m, d)
>           super(y,m,d)
>       end
>   end
>
>   st = "2001.5.28"
>   d = My_date.new(st)
>
> It works fine for me.
>
>                                                         matz.

Hi Matz,

yes that works. Thank you for your help.
Using the -w option, ruby now warns:
(eval):4: warning: instance variable @__11185__ not initialized
(eval):4: warning: instance variable @__10729__ not initialized

I have switched -w off.

Regards,
Michael