mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 16:44:01 +02:00
* object.c (rb_obj_methods): list singleton methods if recur
argument is false; list all methods otherwise. * numeric.c (num_step): double epsilon to make "1.1.step(1.5,0.1)" to work. * ext/gdbm/gdbm.c (fgdbm_values_at): new method to replace select(index..). * ext/sdbm/init.c (fsdbm_values_at): ditto. * ext/dbm/dbm.c (fdbm_values_at): ditto. * ext/dbm/dbm.c (DBM::VERSION): defined. * ext/gdbm/testgdbm.rb: replace select with values_at. * ext/sdbm/testsdbm.rb: ditto. * ext/dbm/testdbm.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3758 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
6154ce97a7
commit
7752fb4205
13 changed files with 128 additions and 26 deletions
12
object.c
12
object.c
|
@ -904,13 +904,23 @@ rb_obj_methods(argc, argv, obj)
|
|||
VALUE *argv;
|
||||
VALUE obj;
|
||||
{
|
||||
retry:
|
||||
if (argc == 0) {
|
||||
VALUE args[1];
|
||||
|
||||
args[0] = Qtrue;
|
||||
return rb_class_instance_methods(1, args, CLASS_OF(obj));
|
||||
}
|
||||
return rb_class_instance_methods(argc, argv, CLASS_OF(obj));
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
static VALUE
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue