1. rb_type(1)
  2. rb_type(1)

NAME

rb_type - return the integer value of a ruby type

SYNOPSIS

static inline int rb_type(VALUE obj);

DESCRIPTION

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.

EXAMPLES

VALUE greeting = rb_str_new2("Hello amigo!");

if( rb_type(greeting) == T_STRING ) {

printf("Greeting is a ruby String");

}

AUTHOR

John Faucett

SEE ALSO

ruby_value_type(3)

  1. February 2014
  2. rb_type(1)