The following is the beginning of a Java-esque new operator. def new o o.class == Class ? o.new : o end Used with the String class you can do: new String # => "" new String('foo') # => "foo" But this is not the case with a class like Object: new Object # okay new Object() # error My question is, what are classes like Array and String defining that Object isn't? And how can I define my own? Thanks in advanced.
on 2008-11-03 18:05