Format() fails when NilObject is passed in. (issue #100) #101

wants to merge 1 commit into


None yet
2 participants

mseymour commented Oct 9, 2012

I have tested the conditional code, and it appears to work correctly.
When a nil is passed in (Or False), it will transform it into a string with #to_s and dup it, otherwise it will just duplicate the object.


dominikh commented Oct 9, 2012

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?


dominikh commented Nov 24, 2012

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.

@dominikh dominikh closed this Nov 24, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment