mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
symbol/type.c: bug_static_p bug_dynamic_p
* ext/-test-/symbol/type.c (bug_static_p, bug_dynamic_p): methods for debug, which predicate the given symbol type. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45779 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
0e7a25bd4e
commit
a80b300416
1 changed files with 14 additions and 0 deletions
|
@ -41,10 +41,24 @@ bug_id2str(VALUE self, VALUE sym)
|
|||
return rb_id2str(SYM2ID(sym));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
bug_static_p(VALUE self, VALUE sym)
|
||||
{
|
||||
return STATIC_SYM_P(sym) ? Qtrue : Qfalse;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
bug_dynamic_p(VALUE self, VALUE sym)
|
||||
{
|
||||
return DYNAMIC_SYM_P(sym) ? Qtrue : Qfalse;
|
||||
}
|
||||
|
||||
void
|
||||
Init_type(VALUE klass)
|
||||
{
|
||||
FOREACH_ID_TYPES(declare_symbol_type_p);
|
||||
rb_define_singleton_method(klass, "attrset", bug_sym_attrset, 1);
|
||||
rb_define_singleton_method(klass, "id2str", bug_id2str, 1);
|
||||
rb_define_singleton_method(klass, "static?", bug_static_p, 1);
|
||||
rb_define_singleton_method(klass, "dynamic?", bug_dynamic_p, 1);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue