pub fn check_to_str(
interp: &mut Artichoke,
value: Value,
) -> Result<Value, Error>Expand description
Fallible conversion of the given value to a Ruby String or nil via
#to_str.
If the given value is a string, it is returned. If the give value responds
to a #to_str method, it is called. Otherwise, a TypeError is raised.
If this function returns Ok, the returned Value is guaranteed to be
either a Ruby String or nil.
ยงErrors
- If the call to
#to_strreturns an error, that error is returned. - If the call to
#to_strreturns anything other than aStringornil, aTypeErroris returned.