Class
8 9 10
# File 'lib/sapphire/Extensions/Module.rb', line 8 def sub_classes self.constants.select {|c| Class === self.const_get(c)} end
2 3 4 5 6
# File 'lib/sapphire/Extensions/Module.rb', line 2 def sub_modules [self] + constants.map {|const| const_get(const) } .select {|const| const.is_a? Module } .flat_map {|const| const.sub_modules } end