Ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e0ba6b95ab71a441357ed5484e33498)
class.h
Go to the documentation of this file.
1#ifndef RBIMPL_INTERN_CLASS_H /*-*-C++-*-vi:se ft=cpp:*/
2#define RBIMPL_INTERN_CLASS_H
24#include "ruby/internal/value.h"
26
28
29/* class.c */
30
31
38VALUE rb_class_new(VALUE super);
39
49VALUE rb_mod_init_copy(VALUE clone, VALUE orig);
50
59void rb_check_inheritable(VALUE super);
60
71VALUE rb_define_class_id(ID id, VALUE super);
72
94VALUE rb_define_class_id_under(VALUE outer, ID id, VALUE super);
95
101VALUE rb_module_new(void);
102
103
109VALUE rb_refinement_new(void);
110
118VALUE rb_define_module_id(ID id);
119
133VALUE rb_define_module_id_under(VALUE outer, ID id);
134
144VALUE rb_mod_included_modules(VALUE mod);
145
158VALUE rb_mod_include_p(VALUE child, VALUE parent);
159
175VALUE rb_mod_ancestors(VALUE mod);
176
188VALUE rb_class_descendants(VALUE klass);
189
201VALUE rb_class_subclasses(VALUE klass);
202
216VALUE rb_class_instance_methods(int argc, const VALUE *argv, VALUE mod);
217
231VALUE rb_class_public_instance_methods(int argc, const VALUE *argv, VALUE mod);
232
246VALUE rb_class_protected_instance_methods(int argc, const VALUE *argv, VALUE mod);
247
261VALUE rb_class_private_instance_methods(int argc, const VALUE *argv, VALUE mod);
262
276VALUE rb_obj_singleton_methods(int argc, const VALUE *argv, VALUE obj);
277
289void rb_define_method_id(VALUE klass, ID mid, VALUE (*func)(ANYARGS), int arity);
290
291/* vm_method.c */
292
312void rb_undef(VALUE mod, ID mid);
313
314/* class.c */
315
327void rb_define_protected_method(VALUE klass, const char *mid, VALUE (*func)(ANYARGS), int arity);
328
340void rb_define_private_method(VALUE klass, const char *mid, VALUE (*func)(ANYARGS), int arity);
341
353void rb_define_singleton_method(VALUE obj, const char *mid, VALUE(*func)(ANYARGS), int arity);
354
378VALUE rb_singleton_class(VALUE obj);
379
381
382#endif /* RBIMPL_INTERN_CLASS_H */
Tweaking visibility of C variables/functions.
#define RBIMPL_SYMBOL_EXPORT_END()
Counterpart of RBIMPL_SYMBOL_EXPORT_BEGIN.
Definition: dllexport.h:106
#define RBIMPL_SYMBOL_EXPORT_BEGIN()
Shortcut macro equivalent to RUBY_SYMBOL_EXPORT_BEGIN extern "C" {.
Definition: dllexport.h:97
VALUE rb_class_protected_instance_methods(int argc, const VALUE *argv, VALUE mod)
Identical to rb_class_instance_methods(), except it returns names of methods that are protected only.
Definition: class.c:1699
VALUE rb_refinement_new(void)
Creates a new, anonymous refinement.
Definition: class.c:935
VALUE rb_class_new(VALUE super)
Creates a new, anonymous class.
Definition: class.c:275
VALUE rb_class_subclasses(VALUE klass)
Queries the class's direct descendants.
Definition: class.c:1521
VALUE rb_singleton_class(VALUE obj)
Finds or creates the singleton class of the passed object.
Definition: class.c:2068
VALUE rb_obj_singleton_methods(int argc, const VALUE *argv, VALUE obj)
Identical to rb_class_instance_methods(), except it returns names of singleton methods instead of ins...
Definition: class.c:1861
VALUE rb_module_new(void)
Creates a new, anonymous module.
Definition: class.c:929
VALUE rb_class_instance_methods(int argc, const VALUE *argv, VALUE mod)
Generates an array of symbols, which are the list of method names defined in the passed class.
Definition: class.c:1684
void rb_check_inheritable(VALUE super)
Asserts that the given class can derive a child class.
Definition: class.c:260
VALUE rb_class_public_instance_methods(int argc, const VALUE *argv, VALUE mod)
Identical to rb_class_instance_methods(), except it returns names of methods that are public only.
Definition: class.c:1737
VALUE rb_define_module_id_under(VALUE outer, ID id)
Identical to rb_define_module_under(), except it takes the name in ID instead of C's string.
Definition: class.c:978
VALUE rb_mod_included_modules(VALUE mod)
Queries the list of included modules.
Definition: class.c:1360
VALUE rb_define_class_id_under(VALUE outer, ID id, VALUE super)
Identical to rb_define_class_under(), except it takes the name in ID instead of C's string.
Definition: class.c:875
VALUE rb_mod_ancestors(VALUE mod)
Queries the module's ancestors.
Definition: class.c:1428
VALUE rb_mod_include_p(VALUE child, VALUE parent)
Queries if the passed module is included by the module.
Definition: class.c:1396
VALUE rb_class_private_instance_methods(int argc, const VALUE *argv, VALUE mod)
Identical to rb_class_instance_methods(), except it returns names of methods that are private only.
Definition: class.c:1722
VALUE rb_mod_init_copy(VALUE clone, VALUE orig)
The comment that comes with this function says :nodoc:.
Definition: class.c:414
VALUE rb_define_module_id(ID id)
This is a very badly designed API that creates an anonymous module.
Definition: class.c:942
VALUE rb_define_class_id(ID id, VALUE super)
This is a very badly designed API that creates an anonymous class.
Definition: class.c:807
void rb_define_protected_method(VALUE klass, const char *mid, VALUE(*func)(ANYARGS), int arity)
Identical to rb_define_method(), except it defines a protected method.
Definition: class.c:1923
void rb_define_private_method(VALUE klass, const char *mid, VALUE(*func)(ANYARGS), int arity)
Identical to rb_define_method(), except it defines a private method.
Definition: class.c:1932
void rb_define_singleton_method(VALUE obj, const char *mid, VALUE(*func)(ANYARGS), int arity)
Identical to rb_define_method(), except it defines a singleton method.
Definition: class.c:2091
void rb_define_method_id(VALUE klass, ID mid, VALUE(*func)(ANYARGS), int arity)
Identical to rb_define_method(), except it takes the name of the method in ID instead of C's string.
Definition: class.c:1905
void rb_undef(VALUE mod, ID mid)
Inserts a method entry that hides previous method definition of the given name.
Definition: vm_method.c:1717
VALUE rb_class_descendants(VALUE klass)
Queries the class's descendants.
#define RBIMPL_ATTR_NONNULL(list)
Wraps (or simulates) __attribute__((nonnull))
Definition: nonnull.h:27
Defines old _.
#define ANYARGS
Functions declared using this macro take arbitrary arguments, including void.
Definition: stdarg.h:64
Defines VALUE and ID.