my question may be very basic n foolish but i m confused why the output is this way.
MyClass = Class.new String
MyClass.ancestors
=> [MyClass, String, ..]
AnotherClass = Class.new MyClass
=> AnotherClass
AnotherClass.ancestors
=> [AnotherClass, MyClass, String, ..]
in the above code, i m creating a new instance of Class named MyClass and have passed the object(everything in ruby is an object) 'String' as the parameter. Why does 'String' occur in the ancestors list for MyClass. I haven't inherited MyClass from String but that's what ruby seems to be doing. It does work as copy constructor but why the inheritance?