I want to define an instance method Date#next which returns the next day. So I made a DateExtension module, like this:
module DateExtension def next(symb=:day) dt = DateTime.now {:day => Date.new(dt.year, dt.month, dt.day + 1), :week => Date.new(dt.year, dt.month, dt.day + 7), :month => Date.new(dt.year, dt.month + 1, dt.day), :year => Date.new(dt.year + 1, dt.month, dt.day)}[symb] end end Using it:
class Date include DateExtension end Calling the method d.next(:week) makes Ruby throw an error ArgumentError: wrong number of arguments (1 for 0). How can I override the default next method from Date class with the one declared in DateExtension module?
