diff options
Diffstat (limited to 'struct.c')
-rw-r--r-- | struct.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -210,7 +210,7 @@ make_struct(name, members, klass) rb_define_singleton_method(nstr, "members", rb_struct_s_members_m, 0); for (i=0; i< RARRAY(members)->len; i++) { ID id = SYM2ID(RARRAY(members)->ptr[i]); - if (rb_is_local_id(id)) { + if (rb_is_local_id(id) || rb_is_const_id(id)) { if (i<sizeof(ref_func)) { rb_define_method_id(nstr, id, ref_func[i], 0); } @@ -496,7 +496,7 @@ inspect_struct(s, dummy, recur) } slot = RARRAY(members)->ptr[i]; id = SYM2ID(slot); - if (rb_is_local_id(id)) { + if (rb_is_local_id(id) || rb_is_const_id(id)) { p = rb_id2name(id); rb_str_cat2(str, p); } |