Martin DeMello
7/28/2008 11:48:00 PM
On Mon, Jul 28, 2008 at 4:33 PM, Sam Haskins <sam.haskins@gmail.com> wrote:
> What sort of situations is that syntax useful in?
When you need an inline array of strings. Compare
MONTHS = ['January', 'February', 'March', 'April', 'May', 'June',
'July', 'August', 'September', 'October', 'November', 'December']
MONTHS = %w(January February March April May June July August
September October November December)
Try typing them both an and you'll see the use of the syntax :)
martin