From: Tom Sawyer Date: 2003-01-08T11:45:06+09:00 Subject: Re: $cgi = CGI.new w/ mod_ruby dangerous or acceptable? okay, i'm implementing singleton pattern for CGI. simple appraoch: require 'singleton' class CGI include Singleton end now CGI.new dosen't work and one must use CGI.instance. but is there a way just to redefine #new to do the same thing rather than having a different method? i'd rather not have to go around changing #new to #instance? seems like i've delt with this before but i don't remember what i came up with. also perhaps i should subclass CGI for this and create CGISingleton rather then directly altering CGI itself. some thoughts on the best approach to take would be greatly welcome. thanks. -transami .''. .''. . *''* :_\/_: . :_\/_: _\(/_ .:.*_\/_* : /\ : .'.:.'. .''.: /\ : ./)\ ':'* /\ * : '..'. -=:o:=- :_\/_:'.:::. | ' *''* * '.\'/.' _\(/_'.':'.' : /\ : ::::: = *_\/_* -= o =- /)\ ' * '..' ':::' === * /\ * .'/.\'. '._____ * | *..* : |. |' .---"| * | _ .--'| || | _| | * | .-'| __ | | | || | .-----. | |' | || | | | | | || | ___' ' /"\ | '-."". '-' '-.' '` |_. ------------------------------------------------------------