From: Robert Klemme Date: 2003-06-12T17:20:58+09:00 Subject: Re: Multiple Initialize methods? see http://www.rubygarden.org/ruby?RubyFromCpp robert "Nick" schrieb im Newsbeitrag news:bc80bi$jp8$1@hercules.btinternet.com... > Hi, > > I need to create a class either with a param in the construction or nothing: > > something = Object.new > > or > > something = Object.new(val1, val2) > > I have created an emtpy initialize() method and one with the two params. If > I try to create the object with nothing (first version) then I get > "ArgumentError: wrong number of arguments(0 for 2)". > > class Something > def initialize() > end > def initialize(xdim, ydim) > @xdim = xdim > @ydim = ydim > end > > I put the empty initialze in when things didnt work, thinking i needed at > least a marker. > > Thanks for any help, > > Nick. > >