Пример #1
0
mrb_value
mrb_obj_methods(mrb_state *mrb, mrb_bool recur, mrb_value obj, mrb_method_flag_t flag)
{
  if (recur)
      return class_instance_method_list(mrb, recur, mrb_class(mrb, obj), 0);
  else
      return mrb_obj_singleton_methods(mrb, recur, obj);
}
Пример #2
0
static mrb_value
mrb_mod_instance_methods(mrb_state *mrb, mrb_value mod)
{
  struct RClass *c = mrb_class_ptr(mod);
  mrb_bool recur = TRUE;
  mrb_get_args(mrb, "|b", &recur);
  return class_instance_method_list(mrb, recur, c, 0);
}
Пример #3
0
VALUE
rb_obj_methods(int argc, VALUE *argv, VALUE obj)
{
    rb_check_arity(argc, 0, 1);
    if (argc > 0 && !RTEST(argv[0])) {
	return rb_obj_singleton_methods(argc, argv, obj);
    }
    return class_instance_method_list(argc, argv, CLASS_OF(obj), 1, ins_methods_i);
}
Пример #4
0
static mrb_value
mrb_mod_instance_methods(mrb_state *mrb, mrb_value mod)
{
  mrb_value *argv;
  int argc;
  struct RClass *c = mrb_class_ptr(mod);

  mrb_get_args(mrb, "*", &argv, &argc);
  return class_instance_method_list(mrb, argc, argv, c, 0);
}
Пример #5
0
mrb_value
mrb_obj_methods(mrb_state *mrb, int argc, mrb_value *argv, mrb_value obj, mrb_method_flag_t flag)
{
retry:
  if (argc == 0) {
      return class_instance_method_list(mrb, argc, argv, mrb_class(mrb, obj), 0);
  }
  else {
      mrb_value recur;

      recur = argv[0];
      if (mrb_test(recur)) {
          argc = 0;
          goto retry;
      }
      return mrb_obj_singleton_methods(mrb, argc, argv, obj);
  }
}
Пример #6
0
VALUE
rb_obj_methods(int argc, VALUE *argv, VALUE obj)
{
  retry:
    if (argc == 0) {
	return class_instance_method_list(argc, argv, CLASS_OF(obj), 1, ins_methods_i);
    }
    else {
	VALUE recur;

	rb_scan_args(argc, argv, "1", &recur);
	if (RTEST(recur)) {
	    argc = 0;
	    goto retry;
	}
	return rb_obj_singleton_methods(argc, argv, obj);
    }
}
Пример #7
0
VALUE
rb_class_public_instance_methods(int argc, VALUE *argv, VALUE mod)
{
    return class_instance_method_list(argc, argv, mod, ins_methods_pub_i);
}
Пример #8
0
VALUE
rb_class_protected_instance_methods(int argc, VALUE *argv, VALUE mod)
{
    return class_instance_method_list(argc, argv, mod, ins_methods_prot_i);
}
Пример #9
0
VALUE
rb_class_private_instance_methods(VALUE mod, SEL sel, int argc, VALUE *argv)
{
    return class_instance_method_list(argc, argv, mod, ins_methods_priv_i);
}
Пример #10
0
Файл: class.c Проект: fi8on/ruby
VALUE
rb_obj_public_methods(int argc, VALUE *argv, VALUE obj)
{
    return class_instance_method_list(argc, argv, CLASS_OF(obj), 1, ins_methods_pub_i);
}