最佳答案
如果我有一个循环,比如
users.each do |u|
#some code
end
其中用户是多个用户的散列。什么是最简单的条件逻辑来查看您是否在用户散列中的最后一个用户上,并且只想为最后一个用户执行特定的代码
users.each do |u|
#code for everyone
#conditional code for last user
#code for the last user
end
end