J
Joel Saltzmanjoelh
What is the %w used for in ruby?
What is the %w used for in ruby?
Hi --
What is the %w used for in ruby?
To create an array of strings:
%w{ one two three } # same as ["one", "two", "three"]
You can use other delimiters, like []. I'm not sure why I've
gravitated toward curly braces for this.
David
--
Rails training from David A. Black and Ruby Power and Light:
* Advancing With Rails August 18-21 Edison, NJ
* Co-taught by D.A. Black and Erik Kastner
See http://www.rubypal.com for details and updates!
What sort of situations is that syntax useful in?Hi --
What is the %w used for in ruby?
To create an array of strings:
%w{ one two three } # same as ["one", "two", "three"]
You can use other delimiters, like []. I'm not sure why I've
gravitated toward curly braces for this.
What sort of situations is that syntax useful in?
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.