如果我有一个循环,如
users.each do |u|
#some code
end
Run Code Online (Sandbox Code Playgroud)
用户是多个用户的哈希值.什么是最简单的条件逻辑,看你是否在用户哈希中的最后一个用户,并且只想为最后一个用户执行特定的代码,所以像
users.each do |u|
#code for everyone
#conditional code for last user
#code for the last user
end
end
Run Code Online (Sandbox Code Playgroud)
谢谢