当我使用:
require 'date'
Time.now.to_date.next_month
它返回
=> #<Date: 2012-07-29 ((2456138j,0s,0n),+0s,2299161j)>
如果我尝试制表符完成,Time.now.to_date.next_month.
我会看到:
1.9.3p194 :081 > Time.now.to_date.next_month.be
Time.now.to_date.next_month.begin Time.now.to_date.next_month.between?
但如果我尝试Time.now.to_date.next_month.begin
我得到
1.9.3p194 :081 > Time.now.to_date.next_month.begin
NoMethodError: undefined method `begin' for #<Date: 2012-07-29 ((...
这是为什么?