On 11 Aug, GOTO Kentaro wrote: > Hi, > > In message "[ruby-talk:00626] Next misbehavior (sorry :-)" [...] > (2) redefine `MyString.new', not `MyString#nitialize. > > class MyString<String > class << self > def new(*args) > res = super(args[0] || "") > res.instance_eval{ initialize(*args) } > res > end > end > Can you explain me, please, why do you do it that way? I have done it as following: class MyString<String def MyString.new(*args) res=super(args[0] || "") res.instance_eval{ initialize *args } res end end It seems to work. Is there any advantage using the `class << whatever' style here? :-/ [...] > > -- gotoken \cle