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

Table subclasses only implement signature_suffix.

The rest of the signature is pretty standard.

Currently ignoring the link href value in signature -
as we currently don't output source files.
parent 82cf8497
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -10,10 +10,8 @@ module JsDuck
      @row_class = "config-row"
    end

    def signature(item)
      id = @cls.full_name+ "-" + item[:name]
      src = "source/sample.html#cfg-" + id
      return "<a id='#{id}'></a><b><a href='#{src}'>#{item[:name]}</a></b> : #{item[:type]}"
    def signature_suffix(item)
      " : " + (item[:type] || "Object")
    end

  end
+2 −5
Original line number Diff line number Diff line
@@ -10,12 +10,9 @@ module JsDuck
      @row_class = "method-row"
    end

    def signature(item)
      id = @cls.full_name+ "-" + item[:name]
      src = "source/sample.html#event-" + id
      return "<a id='#{id}'></a><b><a href='#{src}'>#{item[:name]}</a></b> : ()"
    def signature_suffix(item)
      " : ()"
    end

  end

end
+2 −5
Original line number Diff line number Diff line
@@ -10,11 +10,8 @@ module JsDuck
      @row_class = "method-row"
    end

    def signature(item)
      id = @cls.full_name+ "-" + item[:name]
      src = "source/sample.html#method-" + id
      type = item[:return] ? (item[:return][:type] || "void") : "void"
      return "<a id='#{id}'></a><b><a href='#{src}'>#{item[:name]}</a></b>() : #{type}"
    def signature_suffix(item)
      "() : " + (item[:return] ? (item[:return][:type] || "void") : "void")
    end

  end
+2 −4
Original line number Diff line number Diff line
@@ -10,10 +10,8 @@ module JsDuck
      @row_class = "property-row"
    end

    def signature(item)
      id = @cls.full_name+ "-" + item[:name]
      src = "source/sample.html#prop-" + id
      return "<a id='#{id}'></a><b><a href='#{src}'>#{item[:name]}</a></b> : #{item[:type]}"
    def signature_suffix(item)
      " : " + (item[:type] || "Object")
    end

  end
+7 −1
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@ module JsDuck
  # Base class for creating HTML tables of class members.
  #
  # Subclasses must set variables @type, @id, @title, @column_title,
  # @row_class, and implement the signature() method.
  # @row_class, and implement the signature_suffix() method.
  class Table
    def initialize(cls)
      @cls = cls
@@ -39,6 +39,12 @@ module JsDuck
      ].join("")
    end

    def signature(item)
      id = @cls.full_name+ "-" + item[:name]
      src = "source/sample.html#" + id
      return "<a id='#{id}'></a><b><a href='#{src}'>#{item[:name]}</a></b>" + signature_suffix(item)
    end

    # 116 chars is also where ext-doc makes its cut, but unlike
    # ext-doc we only make the cut when there's more than 120 chars.
    #