From: Simen Date: 2006-04-21T07:18:42+09:00 Subject: Re: Optional Message Parameters? > *? I don't even know how I'd google that :-) The star is used to have fun with parameters. Watch: def have_fun(*args) args.each{|arg| puts arg} end have_fun 1, 2, 3 # outputs 1, 2, 3 It basically takes any additional parameters provided and puts it into an array (with the exception of blocks): def some_args( opt1, opt2, *otheropts ) otheropts end some_args nil, nil, "have", "fun" # => ["have", "fun"] You can use it the other way to: arguments = ["Hello", "world"] send("puts", *arguments) # Outputs the arguments See http://redhanded.hobix.com/bits/wonderOfTheWhenBeFlat.html for creative uses. -- Posted via http://www.ruby-forum.com/.