Permalink
Browse files

Do not include class name in static method names

  • Loading branch information...
1 parent 21129a8 commit 89d36237cb6560521e3106e6bc3ed5cf1068ced5 @grncdr committed May 13, 2012
Showing with 8 additions and 3 deletions.
  1. +8 −3 src/coffeedoc.coffee
View
@@ -90,15 +90,15 @@ documentClass = (cls) ->
name: getFullName(cls.variable)
docstring: docstring
parent: parent
- staticmethods: (documentFunction(m) for m in staticmethods)
+ staticmethods: (documentFunction(m, static: true) for m in staticmethods)
instancemethods: (documentFunction(m) for m in instancemethods)
for method in doc.staticmethods
method.name = method.name.replace(/^this/, doc.name)
return doc
-documentFunction = (func) ->
+documentFunction = (func, opts={}) ->
###
Evaluates a function object as returned by the coffeescript parser,
returning an object of the form:
@@ -127,8 +127,13 @@ documentFunction = (func) ->
else
params = []
+ name = getFullName(func.variable)
+
+ if opts.static
+ name = name.split('.').slice(1).join('.')
+
doc =
- name: getFullName(func.variable)
+ name: name
docstring: docstring
params: params

0 comments on commit 89d3623

Please sign in to comment.