summaryrefslogtreecommitdiff
path: root/class.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-05-06 06:51:31 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-05-06 06:51:31 +0000
commit7752fb4205ecf5de2021a7924c213516c8a8d858 (patch)
tree112f7e4154e500bf48240f8b4cfaab09e351fd6e /class.c
parent6154ce97a7915ac70326c007ee04a22fe5742e04 (diff)
downloadruby-7752fb4205ecf5de2021a7924c213516c8a8d858.tar.gz
* 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
Diffstat (limited to 'class.c')
-rw-r--r--class.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/class.c b/class.c
index c0d7c1ed5f..4b93841d9f 100644
--- a/class.c
+++ b/class.c
@@ -589,7 +589,6 @@ rb_class_protected_instance_methods(argc, argv, mod)
recur = Qtrue;
#endif
}
- if (argc == 0) recur = Qtrue;
return method_list(mod, RTEST(recur), ins_methods_prot_i);
}
@@ -609,7 +608,6 @@ rb_class_private_instance_methods(argc, argv, mod)
recur = Qtrue;
#endif
}
- if (argc == 0) recur = Qtrue;
return method_list(mod, RTEST(recur), ins_methods_priv_i);
}
@@ -624,14 +622,11 @@ rb_class_public_instance_methods(argc, argv, mod)
rb_scan_args(argc, argv, "01", &recur);
if (argc == 0) {
#if RUBY_RELEASE_CODE < 20040101
- rb_warn("instance_methods parameter will default to 'true' in Jan 2004");
+ rb_warn("public_instance_methods parameter will default to 'true' in Jan 2004");
#else
recur = Qtrue;
#endif
- rb_warn("public_instance_methods parameter will default to 'true' in Jan 2004");
- /* recur = Qtrue; */
}
- if (argc == 0) recur = Qtrue;
return method_list(mod, RTEST(recur), ins_methods_pub_i);
}
@@ -641,10 +636,10 @@ rb_obj_singleton_methods(argc, argv, obj)
VALUE *argv;
VALUE obj;
{
- VALUE all, ary, klass;
+ VALUE recur, ary, klass;
st_table *list;
- rb_scan_args(argc, argv, "01", &all);
+ rb_scan_args(argc, argv, "01", &recur);
if (argc == 0) {
#if RUBY_RELEASE_CODE < 20040101
rb_warn("singleton_methods parameter will default to 'true' in Jan 2004");
@@ -658,7 +653,7 @@ rb_obj_singleton_methods(argc, argv, obj)
st_foreach(RCLASS(klass)->m_tbl, method_entry, (st_data_t)list);
klass = RCLASS(klass)->super;
}
- if (RTEST(all)) {
+ if (RTEST(recur)) {
while (klass && TYPE(klass) == T_ICLASS) {
st_foreach(RCLASS(klass)->m_tbl, method_entry, (st_data_t)list);
klass = RCLASS(klass)->super;