[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

do loops and braces

aidy

7/19/2006 12:10:00 PM

Is there anyway I can envelop this in braces and not have a loop 'end'?

def goto_territory_list
ObjectMap.new.instance_eval do
sales_admin_link.click
territories_link.click
end
end

Thanks

Aidy

2 Answers

Michael Fellinger

7/19/2006 12:17:00 PM

0

On Wednesday 19 July 2006 21:10, aidy wrote:
> Is there anyway I can envelop this in braces and not have a loop 'end'?

just do it :)
though it's common practice to use do ... end for blocks over more than one
line
>
> def goto_territory_list
> ObjectMap.new.instance_eval do
> sales_admin_link.click
> territories_link.click
> end
> end
>
> Thanks
>
> Aidy

Nate Smith

7/19/2006 2:12:00 PM

0