From: Xavier Noria Date: 2010-03-21T18:45:40+09:00 Subject: [ruby-core:28837] [Bug #2993] Module#instance_methods' flag seems to be ignored in singleton classes Bug #2993: Module#instance_methods' flag seems to be ignored in singleton classes http://redmine.ruby-lang.org/issues/show/2993 Author: Xavier Noria Status: Open, Priority: Normal Category: core ruby -v: ruby 1.9.2dev (2010-03-14 trunk 26913) [x86_64-darwin10.2.0] Looks like the flag that tells Module#instance_methods whether to include the ones of superclasses is ignored on singleton classes. For example, in 1.9: class A def self.m end end p (class << A; self; end).instance_methods(false) # => [:m, :allocate, :new, :superclass] class B < A end p (class << B; self; end).instance_methods(false) # => [:m, :allocate, :new, :superclass] class C < B end p (class << C; self; end).instance_methods(false) # => [:m, :allocate, :new, :superclass] I tested this against 1.9.2-head, 1.9.1, and 1.8.7, the string in the "ruby -v" form field below corresponds to the first one. ---------------------------------------- http://redmine.ruby-lang.org