From: "Bartosz Dziewoński" Date: 2012-05-23T01:09:27+09:00 Subject: Re: Changing self class from inside a method?? 2012/5/22 David Madison : > Is this just considered impossible, or is there a way to change/convert > the class of self from inside a method?  I can imagine it would cause > complications the moment the class changes, since we'd suddenly be in > the method of the wrong class, but if any language had a way to do it, I > figure it'd be ruby. Fun fact: it's possible in Python. (It tends to lead to segfaults.) It's not possible in Ruby, but may be achievable using a C extension. Still, that seems like a very bad idea. I don't know your usecase, but you could probably either start with an empty array instead of nil, or "guard" all array methods with "ary ||= []". -- Matma Rex