ni_nitdoc: Get all inherited method in a class
authorStefan Lage <lagestfan@gmail.com>
Fri, 28 Jun 2013 21:58:52 +0000 (17:58 -0400)
committerStefan Lage <lagestfan@gmail.com>
Wed, 3 Jul 2013 20:54:25 +0000 (16:54 -0400)
Signed-off-by: Stefan Lage <lagestfan@gmail.com>

src/ni_nitdoc.nit

index fc7899b..70174fa 100644 (file)
@@ -1026,6 +1026,17 @@ redef class MClass
                end
        end
 
+       # Associate MClass to all MMethod include in 'inherited_methods'
+       fun inherited: HashMap[MClass, Set[MMethod]] do
+               var hm = new HashMap[MClass, Set[MMethod]]
+               for method in inherited_methods do
+                       var mclass = method.intro_mclassdef.mclass
+                       if not hm.has_key(mclass) then hm[mclass] = new HashSet[MMethod]
+                       hm[mclass].add(method)
+               end
+               return hm
+       end
+
 end
 
 redef class AStdClassdef