On 1/23/06, Zach <zacharooni / comcast.net> wrote:
> "The fact that the right-hand side is surrounded by curly braces is
> what makes it a Hash. Each key/value pair initially added to the Hash
> looks like "key => value"."
>
> I don't know about the braces, but I was meaning more about the
> Parenthesis (sorry about the type in the earlier example) for example:
> |
> link_to("View Article", :controller => "blah", :action => "yay", :id => 1)|
>
> I guess I'm clueless as to what the difference is now between sending it
> a block and sending it parameterized symbols?

In your previous example, you ARE passing a Hash to the link_to
method. Whenever all the parameters at the end are of the form "key =>
value", Ruby automatically turns them into a single Hash object and
passes that to the method.

When you send a block to a method, you are giving it code that it can
choose to execute any number of times. The block always follows the
parameter list and must begin on the same line as the closing paren.
It starts with either "do" or "{".

--
R. Mark Volkmann
Partner, Object Computing, Inc.