Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Ruby
Special variable within iterators to hold results?
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Wes Gamble, post: 4530058"] I have this: FILTER_COLUMNS = Array.new DISPLAYABLE_COLUMNS.each do |field_array| FILTER_COLUMNS << [ field_array[1], field_array[0] ] end Is there any way to write this so that it could look something like: FILTER_COLUMNS = DISPLAYABLE_COLUMNS.each do |field_array| ??? << [ field_array[1], field_array[0] ] end so that I don't have to bother initializing FILTER_COLUMNS - is there some special variable that holds the intermediate result of the iterator body? Or perhaps an appropriate call to collect? Thanks, Wes [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Ruby
Special variable within iterators to hold results?
Top