有沒有可能覆蓋紅寶石範圍內的點?我的目標是,在創建範圍之前操作給定的對象。如何覆蓋紅寶石範圍內的點?
我想到了這樣的事情
require 'rubygems'
require 'active_support'
#actual i have to call explicitly .to_date
Date.today.to_date..1.month.since.to_date
#this should give me a range with Date objects
Date.today..1.month.since
我已經嘗試覆蓋範圍類的初始化方法。但是這並沒有像預期的那樣奏效。
你真的只需要指定它的第二個參數,因爲這是一個不是日期目的。 'Date.today..1.month.from_now.to_date' – 2010-01-31 02:45:10