From: Christophe Broult Date: 2001-08-30T05:48:14+09:00 Subject: [ruby-talk:20554] RE: Multiple args to constructor This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_001_01C130CB.DD771DB0 Content-Type: text/plain > -----Original Message----- > From: Schaefer, F. [mailto:fschaef@ces.clemson.edu] > Sent: Wednesday, August 29, 2001 4:43 PM > To: ruby-talk@ruby-lang.org > Subject: [ruby-talk:20553] Multiple args to constructor > > > Hi again, > > now, how can I process multiple arguments by the constructor. > The only method, that I know is to use a &block and > apply it with 'instance_eval'. That turns out to be pretty > cumbersome. Sorry I am not sure what you mean here. Do you mean being able to write something like the following? AClass.new(1, "a string") requires you to write class AClass def initialize(aNumber, aString) end end > > By the way, in ruby ARGV[0] is not the application name - is > there something else that tells what the program is called on > the command line. $0 Christophe > > Thanks, > > Frank > -- > ================================================================ > Frank Schaefer (Phone: 001-864-656/0482, FAX: same/4435) > R. 236, Fluor Daniel Building, Mech. Eng. > Clemson University, SC 29634, USA > ------_=_NextPart_001_01C130CB.DD771DB0 Content-Type: text/html RE: [ruby-talk:20553] Multiple args to constructor

> -----Original Message-----
> From: Schaefer, F. [mailto:fschaef@ces.clemson.edu]
> Sent: Wednesday, August 29, 2001 4:43 PM
> To: ruby-talk@ruby-lang.org
> Subject: [ruby-talk:20553] Multiple args to constructor
>
>
> Hi again,
>
> now, how can I process multiple arguments by the constructor.
> The only method, that I know is to use a &block and
> apply it with 'instance_eval'. That turns out to be pretty
> cumbersome.

Sorry I am not sure what you mean here. Do you mean being able to write something like the following?

AClass.new(1, "a string")

requires you to write

class AClass
  def initialize(aNumber, aString)
  end
end

>
> By the way, in ruby ARGV[0] is not the application name - is
> there something else that tells what the program is called on
> the command line.

$0

Christophe

>
> Thanks,
>
> Frank
> --
> ================================================================
>   Frank Schaefer (Phone: 001-864-656/0482, FAX: same/4435)
>   R. 236, Fluor Daniel Building, Mech. Eng.
>   Clemson University, SC 29634, USA
>

------_=_NextPart_001_01C130CB.DD771DB0--