Re: Good solution for managing stylesheets

Ezra Zygmuntowicz
Sat, 20 Aug 2005 04:10:03 -0000

On Aug 19, 2005, at 8:34 PM, Justin Forder wrote:

> Frank Manno wrote:
>
>>> You sometimes see methods with parameters like that (such as
>>> stylesheet_link_tag).  This lets you pass in an unlimited number of
>>> params, and the method treats it as one variable.
>>>
>> Hey Rick,
>> Thanks for clearing that up... I think I do remember reading that in
>> my Ruby book now that you mentioned it.  What would that be called
>> (the use of the asterisk)?  I''m not sure what to search the
index
>> for.
>>
>
> The index has an entry for "* (array argument)" and an entry for
> "Variable-length argument list" - both of these refer to
> information on how to declare methods taking arbitrary numbers of
> arguments. The other point Rick mentioned - prefixing an actual
> parameter with * in a method call - is mentioned in "Invoking a
> Method" (p348 in the second edition). I don''t know what it
would be
> called.
>
> regards
>
>    Justin
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
I have always heard this *arg notation as splatting because the *
looks like a little splat ;-)

-Ezra Zygmuntowicz
WebMaster
Yakima Herald-Republic Newspaper
ezra-gdxLOakOTQ9oetBuM9ipNAC/G2K4zDHf@public.gmane.org
509-577-7732