root/ext/-test-/class/class2name.c

/* [previous][next][first][last][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. class2name
  2. Init_class2name

#include <ruby/ruby.h>

static VALUE
class2name(VALUE self, VALUE klass)
{
    const char *name = rb_class2name(klass);
    return name ? rb_str_new_cstr(name) : Qnil;
}

void
Init_class2name(VALUE klass)
{
    rb_define_singleton_method(klass, "class2name", class2name, 1);
}

/* [previous][next][first][last][top][bottom][index][help] */