From: James Edward Gray II Date: 2005-08-27T03:19:55+09:00 Subject: Re: ruby quiz question '*' on the initialize parameters On Aug 26, 2005, at 1:16 PM, Gaston Garcia wrote: > 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 = banned_words.flatten.sort > @clean_calls = 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? You guessed it. It will collect all passed parameters into an Array object and store that in the variable banned_words. Welcome to Ruby. James Edward Gray II