ok, easier to read version of the code (I hope)
class First
attr_accessor :addresses
def initialize
address
end
def address
@addresses= []
File.open("/RubyDev/useful/lib/list/listtest.txt").each_line do |i|
@addresses << i.chomp
end
end
end
class Server1
b = Last.new
puts "Im Server1"
puts "Sending the following address to: #{b.loopaddress}"
end
class Server2
b = Last.new.loopaddress
puts "Im Server2"
puts "Sending the following address to: #{b.loopaddress}"
end
class Last
n=First.new
email_servers=[Server1.new,Server2.new]
def loopaddress
n.addresses.each_with_index do |i|
i % email_servers.length
end
end
end
Just trying to make the looped addresses be distributed uniquely one at a time between both servers. Thanks