rb_type
- return the integer value of a ruby type
static inline int rb_type(VALUE obj);
The rb_type function takes a ruby object as its argument and returns the integer value of its internal representation in ruby. The integer value is one of the the ruby type definitions, i.e. T_STRING for String objects, T_NIL for NilClass objects, T_SYMBOL for Symbol objects, etc.
VALUE greeting = rb_str_new2("Hello amigo!");
if( rb_type(greeting) == T_STRING ) {
printf("Greeting is a ruby String");
}
John Faucett
ruby_value_type(3)