The code below works fine. But it seem clunky.
How would you combine the following code into one line?
data = Array.new
@results.each{ |result| data.push(result.get_output) }
data.join("\n")
Ruby 1.9.3
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Map the original collection instead of creating a new array first: