From: noreply@... Date: 2006-11-22T17:49:22+09:00 Subject: [ ruby-Bugs-6820 ] #ancestors never includes the singleton class (inconsistent) Bugs item #6820, was opened at 2006-11-22 08:49 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=1698&aid=6820&group_id=426 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: Sylvain Joyeux (lapinot) Assigned to: Nobody (None) Summary: #ancestors never includes the singleton class (inconsistent) Initial Comment: Documentation of Module#ancestors states that the returned array includes the module itself, and it does so for both instances of both Module and Class. However, in singleton classes, the singleton class is not included in the array: module M; end class C; include M end c = C.new c_singleton = (class << c; self end) puts M.ancestors.inspect puts C.ancestors.inspect puts c_singleton.ancestors.inspect yields [M] [C, M, Object, Kernel] [C, M, Object, Kernel] in both ruby 1.8.5 (2006-08-25) [i486-linux] ruby 1.9.0 (2006-06-08) [i486-linux] ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=1698&aid=6820&group_id=426