From: Gaston Garcia Date: 2005-08-27T03:24:11+09:00 Subject: Re: ruby quiz question '*' on the initialize parameters ------=_Part_9826_16593048.1125080649483 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Thanks james, that's a beautiful thing that does!!!=20 -gaston On 8/26/05, James Edward Gray II wrote: >=20 > On Aug 26, 2005, at 1:16 PM, Gaston Garcia wrote: >=20 > > Hi everyone: > > > > On the ruby quiz called: Banned Words (#9), I'm looking at the > > class posted > > there and I came up with something I had never seen before > > (probably because > > I'm really new to Ruby) > > > > class LanguageFilter > > def initialize( *banned_words ) > > @banned_words =3D banned_words.flatten.sort > > @clean_calls =3D 0 > > end > > > > end > > > > I had never seen this: > > > > def initialize(*banned_words) > > > > what does that * do? Does it mean I can send as many parameters as > > I want? >=20 > You guessed it. It will collect all passed parameters into an Array > object and store that in the variable banned_words. >=20 > Welcome to Ruby. >=20 > James Edward Gray II >=20 >=20 --=20 -gaston ------=_Part_9826_16593048.1125080649483--