def find_users_online(count = 1)
users = Array.new
count.times do
users += get_users_online
end
users # <==== I want to remove this here
end
In the code above im must put the "users" variable again at the end of the function to return the right value (users). But is it possible that the times block return the users values and I can remove "users" at the end of the function?
def find_users_online(count = 1)
users = Array.new
count.times.and_return do # <== something like this
users += get_users_online
end
end