1
我有一個問題,Ruby代碼:紅寶石範圍部分
def give_me_all_periods(period, paid_periods)
# Can you help me?
end
period = [1..10]
paid_periods = [1..2, 5..8]
give_me_all_periods(period, paid_periods).should == [1...2, 2...5, 5...8, 8...10]
將paid_periods始終期間內或在這是否需要驗證呢? –
爲什麼它會從'1..2'變爲'1 ... 2'? –