我写了这段代码:
[1,2,3,4].each do |f|
@date = Date.new(2014,f * 3,1)
@begin = @date.beginning_of_quarter
@end = @date.end_of_quarter
puts f + " Quartal von " + @begin + " bis " + @end
end
不知怎的,我得到了错误:
DateTest.rb:2:in `initialize': wrong number of arguments (3 for 0) (ArgumentError)
from DateTest.rb:2:in `new'
from DateTest.rb:2:in `block in <main>'
from DateTest.rb:1:in `each'
from DateTest.rb:1:in `<main>'
我错了什么?谢谢!