require 'active_support/all'
days = 0.day.ago
days += 1 until days.since.wday == 2
next_tuesday = days.since
上面的代码做的不对。但下面是对的。你能告诉我为什么吗?
require 'active_support/all'
current_day = 0.day.ago
current_day += 1.day until current_day.wday == 2
next_tuesday = current_day