46 #define id_match idEqTilde 47 #define id_inspect idInspect 48 #define id_init_copy idInitialize_copy 49 #define id_init_clone idInitialize_clone 50 #define id_init_dup idInitialize_dup 51 #define id_const_missing idConst_missing 53 #define CLASS_OR_MODULE_P(obj) \ 54 (!SPECIAL_CONST_P(obj) && \ 55 (BUILTIN_TYPE(obj) == T_CLASS || BUILTIN_TYPE(obj) == T_MODULE)) 108 RBASIC(obj)->flags = type;
130 if (obj1 == obj2)
return Qtrue;
153 if (obj1 == obj2)
return Qtrue;
203 if (obj1 == obj2)
return Qtrue;
220 rb_obj_not(
VALUE obj)
300 rb_obj_singleton_class(
VALUE obj)
311 ROBJECT(dest)->as.heap.ivptr = 0;
312 ROBJECT(dest)->as.heap.numiv = 0;
313 ROBJECT(dest)->as.heap.iv_index_tbl = 0;
315 if (
RBASIC(obj)->flags & ROBJECT_EMBED) {
326 ROBJECT(dest)->as.heap.ivptr = ptr;
328 ROBJECT(dest)->as.heap.iv_index_tbl =
ROBJECT(obj)->as.heap.iv_index_tbl;
329 RBASIC(dest)->flags &= ~ROBJECT_EMBED;
350 static VALUE immutable_obj_clone(
VALUE obj,
int kwfreeze);
351 static VALUE mutable_obj_clone(
VALUE obj,
int kwfreeze);
354 special_object_p(
VALUE obj)
398 int kwfreeze = freeze_opt(
argc,
argv);
399 if (!special_object_p(obj))
400 return mutable_obj_clone(obj, kwfreeze);
401 return immutable_obj_clone(obj, kwfreeze);
408 int kwfreeze = freeze_opt(argc, argv);
409 return immutable_obj_clone(obj, kwfreeze);
415 static ID keyword_ids[1];
419 if (!keyword_ids[0]) {
435 immutable_obj_clone(
VALUE obj,
int kwfreeze)
444 mutable_obj_clone(
VALUE obj,
int kwfreeze)
446 VALUE clone, singleton;
458 init_copy(clone, obj);
477 if (special_object_p(obj))
return obj;
478 return mutable_obj_clone(obj,
Qtrue);
530 if (special_object_p(obj)) {
552 rb_obj_itself(
VALUE obj)
575 rb_obj_yield_self(
VALUE obj)
592 if (obj == orig)
return obj;
740 rb_obj_inspect(
VALUE obj)
755 class_or_module_required(
VALUE c)
800 c = class_or_module_required(c);
846 c = class_or_module_required(c);
865 cl = class_or_module_required(cl);
866 c = class_or_module_required(c);
889 rb_obj_tap(
VALUE obj)
1236 rb_warning(
"untrusted? is deprecated and its behavior is same as tainted?");
1259 rb_warning(
"untrust is deprecated and its behavior is same as taint");
1283 rb_warning(
"trust is deprecated and its behavior is same as untaint");
1336 rb_bug(
"special consts should be frozen.");
1458 nil_inspect(
VALUE obj)
1481 true_to_s(
VALUE obj)
1558 false_to_s(
VALUE obj)
1697 if (obj1 == obj2 ||
rb_equal(obj1, obj2))
1740 rb_mod_to_s(
VALUE klass)
1743 VALUE refined_class, defined_at;
1760 if (!
NIL_P(refined_class)) {
1765 CONST_ID(id_defined_at,
"__defined_at__");
1829 if (mod == arg)
return Qtrue;
1837 if (class_search_ancestor(arg, mod)) {
1899 return rb_mod_ge(
mod, arg);
1933 rb_module_s_alloc(
VALUE klass)
1942 rb_class_s_alloc(
VALUE klass)
1974 rb_mod_initialize(
VALUE module)
1984 rb_mod_initialize_clone(
VALUE clone,
VALUE orig)
2041 RCLASS_SET_SUPER(klass, super);
2044 rb_mod_initialize(klass);
2051 rb_undefined_alloc(
VALUE klass)
2080 rb_class_alloc(
VALUE klass)
2093 rb_undefined_alloc(klass);
2098 obj = (*allocator)(klass);
2124 return rb_class_alloc(klass);
2128 rb_class_allocate_instance(
VALUE klass)
2151 obj = rb_class_alloc(klass);
2173 return rb_class_s_new(argc, argv, klass);
2231 return RCLASS(klass)->super;
2235 #define id_for_var(obj, name, part, type) \ 2236 id_for_setter(obj, name, type, "`%1$s' is not allowed as "#part" "#type" variable name") 2238 #define id_for_setter(obj, name, type, message) \ 2239 check_setter_id(obj, &(name), rb_is_##type##_id, rb_is_##type##_name, message, strlen(message)) 2242 int (*valid_id_p)(
ID),
int (*valid_name_p)(
VALUE),
2243 const char *message,
size_t message_len)
2248 if (
id ? !valid_id_p(
id) : !valid_name_p(name)) {
2262 rb_is_attr_id(
ID id)
2267 static const char wrong_constant_name[] =
"wrong constant name %1$s";
2268 static const char invalid_attribute_name[] =
"invalid attribute name `%1$s'";
2296 for (i=0; i<
argc; i++) {
2317 rb_mod_attr(
int argc,
VALUE *argv,
VALUE klass)
2319 if (argc == 2 && (argv[1] ==
Qtrue || argv[1] ==
Qfalse)) {
2320 rb_warning(
"optional boolean argument is obsoleted");
2324 return rb_mod_attr_reader(argc, argv, klass);
2338 rb_mod_attr_writer(
int argc,
VALUE *argv,
VALUE klass)
2342 for (i=0; i<
argc; i++) {
2366 rb_mod_attr_accessor(
int argc,
VALUE *argv,
VALUE klass)
2370 for (i=0; i<
argc; i++) {
2421 const char *pbeg, *p, *path, *pend;
2426 recur = (argc == 1) ?
Qtrue : argv[1];
2445 if (p >= pend || !*p) {
2450 if (p + 2 < pend && p[0] ==
':' && p[1] ==
':') {
2460 while (p < pend && *p !=
':') p++;
2462 if (pbeg == p)
goto wrong_name;
2467 if (p < pend && p[0] ==
':') {
2468 if (p + 2 >= pend || p[1] !=
':')
goto wrong_name;
2575 rb_mod_const_defined(
int argc,
VALUE *argv,
VALUE mod)
2579 const char *pbeg, *p, *path, *pend;
2584 recur = (argc == 1) ?
Qtrue : argv[1];
2603 if (p >= pend || !*p) {
2608 if (p + 2 < pend && p[0] ==
':' && p[1] ==
':') {
2618 while (p < pend && *p !=
':') p++;
2620 if (pbeg == p)
goto wrong_name;
2625 if (p < pend && p[0] ==
':') {
2626 if (p + 2 >= pend || p[1] !=
':')
goto wrong_name;
2860 rb_mod_singleton_p(
VALUE klass)
2868 static const struct conv_method_tbl {
2869 const char method[6];
2871 } conv_method_names[] = {
2872 #define M(n) {#n, (unsigned short)idTo_##n} 2886 #define IMPLICIT_CONVERSIONS 7 2889 conv_method_index(
const char *method)
2891 static const char prefix[] =
"to_";
2893 if (strncmp(prefix, method,
sizeof(prefix)-1) == 0) {
2894 const char *
const meth = &method[
sizeof(prefix)-1];
2896 for (i=0; i <
numberof(conv_method_names); i++) {
2897 if (conv_method_names[i].method[0] == meth[0] &&
2898 strcmp(conv_method_names[i].method, meth) == 0) {
2903 return numberof(conv_method_names);
2907 convert_type_with_id(
VALUE val,
const char *tname,
ID method,
int raise,
int index)
2913 ((index < 0 ? conv_method_index(
rb_id2name(method)) : index)
2915 "no implicit conversion of" :
"can't convert";
2916 const char *cname =
NIL_P(val) ?
"nil" :
2917 val ==
Qtrue ?
"true" :
2918 val ==
Qfalse ?
"false" :
2932 convert_type(
VALUE val,
const char *tname,
const char *method,
int raise)
2934 int i = conv_method_index(method);
2936 conv_method_names[i].id :
rb_intern(method);
2937 return convert_type_with_id(val, tname, m,
raise, i);
2943 conversion_mismatch(
VALUE val,
const char *tname,
const char *method,
VALUE result)
2969 if (
TYPE(val) == type)
return val;
2970 v = convert_type(val, tname, method,
TRUE);
2971 if (
TYPE(v) != type) {
2972 conversion_mismatch(val, tname, method, v);
2983 if (
TYPE(val) == type)
return val;
2984 v = convert_type_with_id(val, tname, method,
TRUE, -1);
2985 if (
TYPE(v) != type) {
3012 v = convert_type(val, tname, method,
FALSE);
3014 if (
TYPE(v) != type) {
3015 conversion_mismatch(val, tname, method, v);
3028 v = convert_type_with_id(val, tname, method,
FALSE, -1);
3030 if (
TYPE(v) != type) {
3038 rb_to_integer(
VALUE val,
const char *method)
3044 v = convert_type(val,
"Integer", method,
TRUE);
3046 conversion_mismatch(val,
"Integer", method, v);
3068 v = convert_type(val,
"Integer", method,
FALSE);
3086 return rb_to_integer(val,
"to_int");
3105 rb_convert_to_integer(
VALUE val,
int base)
3111 if (base != 0)
goto arg_error;
3117 if (base != 0)
goto arg_error;
3123 else if (
NIL_P(val)) {
3124 if (base != 0)
goto arg_error;
3133 tmp = convert_type(val,
"Integer",
"to_int",
FALSE);
3135 return rb_to_integer(val,
"to_i");
3150 return rb_convert_to_integer(val, 0);
3178 rb_f_integer(
int argc,
VALUE *argv,
VALUE obj)
3193 return rb_convert_to_integer(arg, base);
3213 const char *ellipsis =
"";
3215 enum {max_width = 20};
3216 #define OutOfRange() ((end - p > max_width) ? \ 3217 (w = max_width, ellipsis = "...") : \ 3218 (w = (int)(end - p), ellipsis = "")) 3224 if (!badcheck && p[0] ==
'0' && (p[1] ==
'x' || p[1] ==
'X')) {
3229 if (
errno == ERANGE) {
3231 rb_warning(
"Float %.*s%s out of range", w, p, ellipsis);
3244 char *e = buf +
sizeof(
buf) - 1;
3247 while (p < end && n < e) prev = *n++ = *p++;
3252 if (badcheck)
goto bad;
3257 if (n < e) *n++ = prev;
3262 if (!badcheck && p[0] ==
'0' && (p[1] ==
'x' || p[1] ==
'X')) {
3267 if (
errno == ERANGE) {
3269 rb_warning(
"Float %.*s%s out of range", w, p, ellipsis);
3273 if (!end || p == end)
goto bad;
3274 while (*end &&
ISSPACE(*end)) end++;
3278 if (
errno == ERANGE) {
3309 if (badcheck && memchr(s,
'\0', len)) {
3313 char *p =
ALLOCV(v, (
size_t)len + 1);
3326 #define fix2dbl_without_to_f(x) (double)FIX2LONG(x) 3327 #define big2dbl_without_to_f(x) rb_big2dbl(x) 3328 #define int2dbl_without_to_f(x) \ 3329 (FIXNUM_P(x) ? fix2dbl_without_to_f(x) : big2dbl_without_to_f(x)) 3330 #define rat2dbl_without_to_f(x) \ 3331 (int2dbl_without_to_f(rb_rational_num(x)) / \ 3332 int2dbl_without_to_f(rb_rational_den(x))) 3334 #define special_const_to_float(val, pre, post) \ 3337 rb_raise_static(rb_eTypeError, pre "nil" post); \ 3339 rb_raise_static(rb_eTypeError, pre "true" post); \ 3341 rb_raise_static(rb_eTypeError, pre "false" post); \ 3346 conversion_to_float(
VALUE val)
3348 special_const_to_float(val,
"can't convert ",
" into Float");
3352 implicit_conversion_to_float(
VALUE val)
3354 special_const_to_float(val,
"no implicit conversion to float from ",
"");
3358 to_float(
VALUE *valp)
3363 *valp =
DBL2NUM(fix2dbl_without_to_f(val));
3370 conversion_to_float(val);
3379 *valp =
DBL2NUM(big2dbl_without_to_f(val));
3382 *valp =
DBL2NUM(rat2dbl_without_to_f(val));
3400 switch (to_float(&val)) {
3433 numeric_to_float(
VALUE val)
3450 switch (to_float(&val)) {
3454 return numeric_to_float(val);
3477 basic_to_f_p(
VALUE klass)
3489 return fix2dbl_without_to_f(val);
3492 return rb_float_flonum_value(val);
3495 conversion_to_float(val);
3501 return rb_float_noflonum_value(val);
3504 return big2dbl_without_to_f(val);
3508 return rat2dbl_without_to_f(val);
3512 val = numeric_to_float(val);
3528 return fix2dbl_without_to_f(val);
3531 return rb_float_flonum_value(val);
3534 implicit_conversion_to_float(val);
3540 return rb_float_noflonum_value(val);
3542 return big2dbl_without_to_f(val);
3544 return rat2dbl_without_to_f(val);
3678 dig_basic_p(
VALUE obj,
struct dig_method *cache)
3681 if (klass != cache->klass) {
3682 cache->klass = klass;
3685 return cache->basic;
3689 no_dig_method(
int found,
VALUE recv,
ID mid,
int argc,
const VALUE *argv,
VALUE data)
3701 struct dig_method hash = {
Qnil}, ary = {
Qnil}, strt = {
Qnil};
3704 if (
NIL_P(obj))
return notfound;
3708 if (dig_basic_p(obj, &hash)) {
3714 if (dig_basic_p(obj, &ary)) {
3720 if (dig_basic_p(obj, &strt)) {
3728 no_dig_method, obj);
3903 #define rb_intern(str) rb_intern_const(str) void rb_define_global_const(const char *, VALUE)
#define RBASIC_CLEAR_CLASS(obj)
VALUE rb_cvar_get(VALUE, ID)
VALUE rb_mod_module_exec(int, const VALUE *, VALUE)
ID rb_check_id(volatile VALUE *)
Returns ID for the given name if it is interned already, or 0.
VALUE rb_check_to_float(VALUE val)
Tries to convert an object into Float.
int rb_is_instance_id(ID id)
void rb_bug(const char *fmt,...)
VALUE rb_class_public_instance_methods(int argc, const VALUE *argv, VALUE mod)
VALUE rb_mod_include_p(VALUE mod, VALUE mod2)
VALUE rb_mod_public_constant(int argc, const VALUE *argv, VALUE obj)
void rb_check_inheritable(VALUE super)
Ensures a class can be derived from super.
VALUE rb_mod_const_missing(VALUE klass, VALUE name)
VALUE rb_check_to_int(VALUE val)
Tries to convert val into Integer.
void rb_undef_alloc_func(VALUE)
VALUE rb_cTrueClass
TrueClass class.
int rb_block_given_p(void)
Determines if the current method is given a block.
VALUE rb_f_sprintf(int, const VALUE *)
void rb_obj_infect(VALUE victim, VALUE carrier)
Convenient function to infect victim with the taintedness of carrier.
#define rb_usascii_str_new2
void rb_raise(VALUE exc, const char *fmt,...)
#define rb_name_err_raise_str(mesg, recv, name)
int rb_get_kwargs(VALUE keyword_hash, const ID *table, int required, int optional, VALUE *values)
VALUE rb_class_protected_instance_methods(int argc, const VALUE *argv, VALUE mod)
#define CLASS_OR_MODULE_P(obj)
VALUE rb_mod_ancestors(VALUE mod)
VALUE rb_obj_not_equal(VALUE obj1, VALUE obj2)
call-seq: obj != other -> true or false
ID rb_check_id_cstr(const char *ptr, long len, rb_encoding *enc)
int rb_is_const_id(ID id)
void rb_copy_wb_protected_attribute(VALUE dest, VALUE obj)
VALUE rb_str_escape(VALUE str)
void rb_define_private_method(VALUE klass, const char *name, VALUE(*func)(ANYARGS), int argc)
void rb_check_trusted(VALUE obj)
VALUE rb_check_convert_type_with_id(VALUE, int, const char *, ID)
rb_encoding * rb_default_internal_encoding(void)
void rb_cvar_set(VALUE, ID, VALUE)
VALUE rb_str_concat(VALUE, VALUE)
VALUE rb_mod_init_copy(VALUE clone, VALUE orig)
VALUE rb_obj_init_dup_clone(VALUE obj, VALUE orig)
:nodoc: Default implementation of #initialize_dup and #initialize_clone
double rb_cstr_to_dbl(const char *p, int badcheck)
Parses a string representation of a floating point number.
VALUE rb_String(VALUE val)
Equivalent to Kernel#String in Ruby.
VALUE rb_funcall(VALUE, ID, int,...)
Calls a method.
void Init_class_hierarchy(void)
#define RBASIC_SET_CLASS(obj, cls)
VALUE rb_obj_dup(VALUE obj)
call-seq: obj.dup -> an_object
VALUE rb_ivar_get(VALUE, ID)
VALUE rb_exec_recursive(VALUE(*)(VALUE, VALUE, int), VALUE, VALUE)
void rb_define_alloc_func(VALUE, rb_alloc_func_t)
VALUE rb_Integer(VALUE val)
Equivalent to Kernel#Integer in Ruby.
VALUE rb_obj_alloc(VALUE klass)
Allocates an instance of klass.
int rb_const_defined(VALUE, ID)
VALUE rb_check_convert_type(VALUE val, int type, const char *tname, const char *method)
Tries to convert an object into another type.
VALUE rb_obj_untrusted(VALUE obj)
call-seq: obj.untrusted? -> true or false
VALUE rb_cBasicObject
BasicObject class.
#define id_for_var(obj, name, part, type)
void rb_include_module(VALUE klass, VALUE module)
VALUE rb_refinement_module_get_refined_class(VALUE module)
#define RGENGC_WB_PROTECTED_OBJECT
void rb_define_global_function(const char *name, VALUE(*func)(ANYARGS), int argc)
Defines a global function.
VALUE rb_obj_init_copy(VALUE obj, VALUE orig)
:nodoc: Default implementation of #initialize_copy
void rb_obj_call_init(VALUE obj, int argc, const VALUE *argv)
Calls #initialize method of obj with the given arguments.
VALUE rb_inspect(VALUE obj)
Convenient wrapper of Object::inspect.
void rb_undef_method(VALUE klass, const char *name)
VALUE rb_ivar_defined(VALUE, ID)
#define rb_name_err_raise(mesg, recv, name)
VALUE rb_mod_remove_cvar(VALUE, VALUE)
void rb_ivar_foreach(VALUE, int(*)(ANYARGS), st_data_t)
const char * rb_obj_classname(VALUE)
VALUE rb_equal_opt(VALUE obj1, VALUE obj2)
VALUE rb_obj_untrust(VALUE obj)
call-seq: obj.untrust -> obj
VALUE rb_cClass
Class class.
RUBY_SYMBOL_EXPORT_BEGIN typedef unsigned long st_data_t
#define NEWOBJ_OF(obj, type, klass, flags)
VALUE rb_to_float(VALUE val)
Converts a Numeric object into Float.
VALUE rb_cNilClass
NilClass class.
VALUE rb_singleton_class(VALUE obj)
Returns the singleton class of obj.
VALUE rb_obj_class(VALUE obj)
call-seq: obj.class -> class
#define RB_TYPE_P(obj, type)
VALUE rb_obj_is_kind_of(VALUE obj, VALUE c)
call-seq: obj.is_a?(class) -> true or false obj.kind_of?(class) -> true or false
rb_encoding * rb_default_external_encoding(void)
VALUE rb_obj_tainted(VALUE obj)
call-seq: obj.tainted? -> true or false
VALUE rb_cvar_defined(VALUE, ID)
VALUE rb_class_inherited(VALUE super, VALUE klass)
Calls Class::inherited.
VALUE rb_obj_taint(VALUE obj)
call-seq: obj.taint -> obj
#define rb_intern_str(string)
VALUE rb_equal(VALUE obj1, VALUE obj2)
call-seq: obj === other -> true or false
VALUE rb_class_name(VALUE)
VALUE rb_dbl2big(double d)
VALUE rb_convert_type_with_id(VALUE, int, const char *, ID)
void rb_gc_copy_finalizer(VALUE dest, VALUE obj)
#define id_for_setter(obj, name, type, message)
VALUE rb_obj_dig(int argc, VALUE *argv, VALUE self, VALUE notfound)
double rb_num_to_dbl(VALUE val)
VALUE rb_ary_at(VALUE ary, VALUE pos)
VALUE rb_str_to_inum(VALUE str, int base, int badcheck)
void rb_attr(VALUE, ID, int, int, int)
VALUE rb_str_cat2(VALUE, const char *)
VALUE rb_obj_as_string(VALUE)
VALUE rb_obj_public_methods(int argc, const VALUE *argv, VALUE obj)
VALUE rb_any_to_s(VALUE obj)
call-seq: obj.to_s -> string
VALUE rb_check_to_integer(VALUE val, const char *method)
Tries to convert val into Integer.
void rb_invalid_str(const char *str, const char *type)
VALUE rb_define_class(const char *name, VALUE super)
Defines a top-level class.
VALUE rb_mKernel
Kernel module.
VALUE rb_struct_lookup(VALUE s, VALUE idx)
VALUE rb_immutable_obj_clone(int, VALUE *, VALUE)
VALUE rb_obj_is_instance_of(VALUE obj, VALUE c)
call-seq: obj.instance_of?(class) -> true or false
#define MEMCPY(p1, p2, type, n)
rb_alloc_func_t rb_get_alloc_func(VALUE)
void rb_obj_copy_ivar(VALUE dest, VALUE obj)
VALUE rb_Array(VALUE val)
Equivalent to Kernel#Array in Ruby.
VALUE rb_cModule
Module class.
#define RUBY_DTRACE_CREATE_HOOK(name, arg)
#define IMPLICIT_CONVERSIONS
VALUE rb_const_get(VALUE, ID)
VALUE rb_str_subseq(VALUE, long, long)
void rb_define_alias(VALUE klass, const char *name1, const char *name2)
Defines an alias of a method.
VALUE rb_check_funcall_with_hook(VALUE recv, ID mid, int argc, const VALUE *argv, rb_check_funcall_hook *hook, VALUE arg)
void rb_deprecate_constant(VALUE mod, const char *name)
VALUE rb_obj_reveal(VALUE obj, VALUE klass)
Make a hidden object visible again.
VALUE rb_obj_freeze(VALUE obj)
call-seq: obj.freeze -> obj
VALUE rb_sprintf(const char *format,...)
int rb_is_const_name(VALUE name)
VALUE rb_const_missing(VALUE klass, VALUE name)
VALUE rb_class_search_ancestor(VALUE klass, VALUE super)
VALUE rb_Hash(VALUE val)
Equivalent to Kernel#Hash in Ruby.
int rb_scan_args(int argc, const VALUE *argv, const char *fmt,...)
VALUE rb_class_inherited_p(VALUE mod, VALUE arg)
call-seq: mod <= other -> true, false, or nil
VALUE rb_ivar_set(VALUE, ID, VALUE)
VALUE rb_check_hash_type(VALUE hash)
unsigned char buf[MIME_BUF_SIZE]
VALUE rb_class_instance_methods(int argc, const VALUE *argv, VALUE mod)
VALUE rb_obj_frozen_p(VALUE obj)
call-seq: obj.frozen? -> true or false
void rb_const_set(VALUE, ID, VALUE)
#define RETURN_SIZED_ENUMERATOR(obj, argc, argv, size_fn)
const char * rb_class2name(VALUE)
VALUE rb_mod_class_variables(int, const VALUE *, VALUE)
#define FUNC_MINIMIZED(x)
RUBY_EXTERN VALUE rb_cInteger
VALUE rb_make_metaclass(VALUE obj, VALUE unused)
VALUE rb_obj_protected_methods(int argc, const VALUE *argv, VALUE obj)
VALUE rb_check_funcall(VALUE, ID, int, const VALUE *)
const char * rb_id2name(ID)
#define rb_enc_asciicompat(enc)
VALUE rb_obj_hide(VALUE obj)
Make the object invisible from Ruby code.
RUBY_EXTERN VALUE rb_cNumeric
VALUE rb_obj_trust(VALUE obj)
call-seq: obj.trust -> obj
int rb_is_const_sym(VALUE sym)
VALUE rb_obj_remove_instance_variable(VALUE, VALUE)
#define RB_FLOAT_TYPE_P(obj)
VALUE rb_fstring_new(const char *ptr, long len)
register unsigned int len
VALUE rb_mod_constants(int, const VALUE *, VALUE)
VALUE rb_obj_hash(VALUE obj)
VALUE rb_eql_opt(VALUE obj1, VALUE obj2)
int rb_const_defined_at(VALUE, ID)
rb_encoding * rb_enc_get(VALUE obj)
void rb_singleton_class_attached(VALUE klass, VALUE obj)
Attach a object to a singleton class.
VALUE rb_yield_values2(int n, const VALUE *argv)
VALUE rb_module_new(void)
VALUE rb_cFalseClass
FalseClass class.
double rb_str_to_dbl(VALUE str, int badcheck)
Parses a string representation of a floating point number.
VALUE rb_Float(VALUE val)
Equivalent to Kernel#Float in Ruby.
#define RBASIC_CLASS(obj)
VALUE rb_class_superclass(VALUE klass)
call-seq: class.superclass -> a_super_class or nil
VALUE rb_check_array_type(VALUE ary)
VALUE rb_hash_aref(VALUE hash, VALUE key)
VALUE rb_convert_type(VALUE val, int type, const char *tname, const char *method)
Converts an object into another type.
VALUE rb_str_catf(VALUE str, const char *format,...)
VALUE rb_check_string_type(VALUE)
VALUE rb_obj_singleton_methods(int argc, const VALUE *argv, VALUE obj)
void rb_warning(const char *fmt,...)
VALUE rb_mod_remove_const(VALUE, VALUE)
VALUE rb_class_new_instance(int argc, const VALUE *argv, VALUE klass)
Allocates and initializes an instance of klass.
int rb_is_local_name(VALUE name)
int rb_method_basic_definition_p(VALUE, ID)
VALUE rb_mod_private_constant(int argc, const VALUE *argv, VALUE obj)
VALUE rb_class_private_instance_methods(int argc, const VALUE *argv, VALUE mod)
int rb_is_local_id(ID id)
VALUE rb_obj_methods(int argc, const VALUE *argv, VALUE obj)
double rb_num2dbl(VALUE val)
Converts a Numeric object to double.
VALUE rb_obj_untaint(VALUE obj)
call-seq: obj.untaint -> obj
VALUE rb_const_get_at(VALUE, ID)
VALUE rb_cData
Data class.
RUBY_EXTERN VALUE rb_cRational
int rb_eql(VALUE obj1, VALUE obj2)
Determines if obj1 and obj2 are equal in terms of Object::eql?.
#define StringValuePtr(v)
VALUE rb_mod_included_modules(VALUE mod)
#define rb_check_frozen(obj)
#define CONST_ID(var, str)
VALUE rb_str_intern(VALUE)
#define rb_intern_const(str)
void rb_copy_generic_ivar(VALUE, VALUE)
#define SPECIAL_CONST_P(x)
VALUE rb_define_module(const char *name)
int rb_enc_str_asciionly_p(VALUE)
VALUE rb_usascii_str_new(const char *, long)
#define RB_INTEGER_TYPE_P(obj)
VALUE(* rb_alloc_func_t)(VALUE)
VALUE rb_obj_private_methods(int argc, const VALUE *argv, VALUE obj)
VALUE rb_class_real(VALUE cl)
Looks up the nearest ancestor of cl, skipping singleton classes or module inclusions.
VALUE rb_obj_clone(VALUE obj)
:nodoc Almost same as Object::clone ++
void rb_define_method(VALUE klass, const char *name, VALUE(*func)(ANYARGS), int argc)
VALUE rb_str_append(VALUE, VALUE)
VALUE rb_obj_setup(VALUE obj, VALUE klass, VALUE type)
Fills common (RBasic) fields in obj.
VALUE rb_class_boot(VALUE super)
A utility function that wraps class_alloc.
#define rb_obj_instance_variables(object)
VALUE rb_cObject
Object class.
st_index_t rb_ivar_count(VALUE)
VALUE rb_mod_deprecate_constant(int argc, const VALUE *argv, VALUE obj)
VALUE rb_to_int(VALUE val)
Converts val into Integer.
VALUE rb_attr_get(VALUE, ID)
VALUE rb_singleton_class_clone_and_attach(VALUE obj, VALUE attach)
VALUE rb_class_get_superclass(VALUE klass)
Returns the superclass of klass The return value might be an iclass of a module, unlike rb_class_supe...