How can I create list of IP address with comma separated when using each loop?
ip_list = [];
hostnames.each do |host|
puts host.ip
end
I tried ip_list.join but that isn't working at all. I want all the host IP in a variable with comma seperated.
I want the output to be comma separated string.
Example:
puts ip_list
10.10.10.10, 10.10.10.11
hostnames? Can you add what that variable holds?