Closed mseymour closed 11 years ago
Not sure it's the responsibility of Format() to deal with objects other than strings. Maybe you should #to_s the object you pass to Format() instead?
The documentation explicitly says that the parameter has to be a String, not that it implements #to_s
, and I think I'll go with that.
Besides, your patch only adds a special case for nil
, and I don't see why we should treat it special.
I have tested the conditional code, and it appears to work correctly. When a
nil
is passed in (OrFalse
), it will transform it into a string with#to_s
and dup it, otherwise it will just duplicate the object.