Project

General

Profile

Bug #2210 ยป string-try-convert.patch

runpaint (Run Paint Run Run), 10/14/2009 06:54 PM

View differences:

string.c
* String.try_convert(obj) -> string or nil
*
* Try to convert <i>obj</i> into a String, using to_str method.
* Returns converted regexp or nil if <i>obj</i> cannot be converted
* Returns converted string or nil if <i>obj</i> cannot be converted
* for any reason.
*
* String.try_convert("str") # => str
    (1-1/1)