Using ruby 1.6.0 and trying to subclass the Date class like
this:
class My_date < Date
def initialize(st)
l = split(".")
y, m, d = l.collect{|s| s.to_i}
super(y,m,d)
end
end
ruby throws the following error messages when invoking:
d = My_date.new("2001.5.28")
/usr/local/lib/ruby/1.6/date.rb:33:in `civil_to_jd':
undefined method `-' for "2001.5.28":String (NameError)
/usr/local/lib/ruby/1.6/date.rb:139:in `exist3?'
/usr/local/lib/ruby/1.6/date.rb:147:in `new3'
I am calling the super method after converting the string
into 3 integers, but obviously the constructor of Date is
called before with the given string.
Any help would be appreciated.
Michael