2011-05-17 60 views

回答

1

你可以過載/猴子修補現有的方法。例如:

class Date 
    class << self 
    alias :parse_with_comp :parse 
    end 
    def self.parse(str='-4712-01-01', sg=ITALY) 
    self.parse_with_comp(str,true,sg) 
    end 
end