From: Jason Roelofs Date: 2007-12-18T21:33:38+09:00 Subject: Re: how to pass unkown length of parameters into a class method ------=_Part_3096_4770975.1197981218028 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline def Example(*args) args.each do |arg| # Process individual argument end end Jason On Dec 18, 2007 7:16 AM, Peter Loftus wrote: > #!/usr/bin/ruby > class Example > def Examplemethod(var1) > puts var1 > end > end > > Check = Example.new > Check.Examplemethod("Loftz") > > Hey guys > > So this is just calling a method that prints out a name. Im just > wondering can i specify that there may be mulitple parameters going into > this method > > for example > Check.Example("Loftz","peter","john","paul","gary") > > and have that method inside the class Example not know how many > parameters are going to be passed into it? > > def Examplemethod(?) > > Regards > Loftz > -- > Posted via http://www.ruby-forum.com/. > > ------=_Part_3096_4770975.1197981218028--