Bugs item #6400, was opened at 2006-10-30 18:20
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=1698&aid=6400&group_id=426

Category: Core
Group: 1.8.x
Status: Open
Resolution: None
Priority: 3
Submitted By: David Wheeler (theory)
Assigned to: Nobody (None)
Summary: Time Does not Respect Subclasses

Initial Comment:
Some of the core Time class constructors do not return objects in the proper class for subclasses:

  require 'time'
  class MyTime < Time
  end
  puts MyTime.parse("16:30").class

This example outputs "Time"; I would argue that it should output "MyTime". IOW, constructors should return objects of the class on which the constructor was called.

The methods that have this bug include:

  Time.parse()
  Time.httpdate()
  Time.rfc2822()
  Time.rfc822()
  Time#getlocal()
  Time#getutc()
  Time#getgm()

Thanks!


----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=1698&aid=6400&group_id=426