mrb_value mrb_mod_const_get(mrb_state *mrb, mrb_value mod) { mrb_value sym; mrb_get_args(mrb, "o", &sym); check_const_name(mrb, mrb_sym_value(mrb,sym)); return mrb_const_get(mrb, mod, mrb_sym_value(mrb, sym)); }
mrb_value mrb_mod_const_get(mrb_state *mrb, mrb_value mod) { mrb_sym id; mrb_get_args(mrb, "n", &id); check_const_name(mrb, id); return mrb_const_get(mrb, mod, id); }
mrb_value mrb_mod_const_set(mrb_state *mrb, mrb_value mod) { mrb_value sym, value; mrb_get_args(mrb, "oo", &sym, &value); check_const_name(mrb, mrb_sym_value(mrb,sym)); mrb_const_set(mrb, mod, mrb_sym_value(mrb, sym), value); return value; }
mrb_value mrb_mod_const_set(mrb_state *mrb, mrb_value mod) { mrb_sym id; mrb_value value; mrb_get_args(mrb, "no", &id, &value); check_const_name(mrb, id); mrb_const_set(mrb, mod, id, value); return value; }
mrb_value mrb_mod_const_defined(mrb_state *mrb, mrb_value mod) { mrb_value sym; mrb_get_args(mrb, "o", &sym); check_const_name(mrb, mrb_sym_value(mrb,sym)); if(mrb_const_defined(mrb, mod, mrb_sym_value(mrb, sym))) { return mrb_true_value(); } return mrb_false_value(); }
mrb_value mrb_mod_const_defined(mrb_state *mrb, mrb_value mod) { mrb_sym id; mrb_bool const_defined_p; mrb_get_args(mrb, "n", &id); check_const_name(mrb, id); const_defined_p = mrb_const_defined(mrb, mod, id); return mrb_bool_value(const_defined_p); }
mrb_value mrb_mod_remove_const(mrb_state *mrb, mrb_value mod) { mrb_sym id; mrb_value val; mrb_get_args(mrb, "n", &id); check_const_name(mrb, id); val = mrb_iv_remove(mrb, mod, id); if (mrb_undef_p(val)) { mrb_name_error(mrb, id, "constant %S not defined", mrb_sym2str(mrb, id)); } return val; }