Todd Benson
7/23/2008 5:25:00 PM
On Wed, Jul 23, 2008 at 12:09 PM, aidy <aidy.lewis@googlemail.com> wrote:
> Hi,
>
> Is it possible to use multiple constructors in Ruby?
>
> class SQLServerConnection
>
> def initialize(server_name, db)
>
> end
>
> def initialize(server_name, db, user_name, password)
>
> end
> end
You can send your initialize an array or hash, or you can do
class C
def initialize( a, b, *c )
#verify and do stuff
end
end
hth,
Todd