Sha256: 13c28bdaf2665a922f21b50f5a0da86ab829ded5759cbf04ac35d0e0babd783c
Contents?: true
Size: 805 Bytes
Versions: 12
Compression:
Stored size: 805 Bytes
Contents
#include "classpath.h" VALUE class2path(klass) VALUE klass; { VALUE path = rb_class_path(klass); char *n = RSTRING(path)->ptr; if (n[0] == '#') { rb_raise(rb_eTypeError, "can't dump anonymous %s %s", (TYPE(klass) == T_CLASS ? "class" : "module"), n); } if (rb_path2class(n) != rb_class_real(klass)) { rb_raise(rb_eTypeError, "%s can't be referred", n); } return path; } VALUE path2class(path) const char *path; { VALUE v = rb_path2class(path); if (TYPE(v) != T_CLASS) { rb_raise(rb_eArgError, "%s does not refer class", path); } return v; } VALUE path2module(path) const char *path; { VALUE v = rb_path2class(path); if (TYPE(v) != T_MODULE) { rb_raise(rb_eArgError, "%s does not refer module", path); } return v; }
Version data entries
12 entries across 11 versions & 1 rubygems