Commit e6d5ea3e authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Showing parameter list in method documentation.

parent a79d3bb5
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -11,7 +11,14 @@ module JsDuck
    end

    def signature_suffix(item)
      "() : " + (item[:return] ? (item[:return][:type] || "void") : "void")
      short_param_list(item) + " : " + (item[:return] ? (item[:return][:type] || "void") : "void")
    end

    def short_param_list(item)
      params = item[:params].collect do |p|
        (p[:type] || "Object") + " " + (p[:name] || "")
      end
      return params.length > 0 ? ("( " + params.join(", ") + " )") : "()"
    end

  end