function convert_type

[edit]
static VALUE convert_type(VALUE val, const char *tname, const char *method, int raise)