Marry Jane Marry Jane - 1 year ago 57
Ruby Question

Spits out 1 message instead of more than 1 message

I want to make a command that shows the people in a chatroom. I did...

m.roster.keys.each do |v|
. When I say that command, it gives out •user1
•user2 •user 3 •user4... (more than 4 messages). How can I make it by sending 1 message that contains all of the users in the chatroom instead of more than 1?

Answer Source

I believe this is what you are looking for :

m.say( { |v| "•#{v}" }.join(' '), nick)