lib/jsduck/method_table.rb in jsduck-0.5 vs lib/jsduck/method_table.rb in jsduck-0.6

- old
+ new

@@ -3,23 +3,19 @@ require 'jsduck/long_params' module JsDuck class MethodTable < Table - def initialize(cls, cache={}) - super(cls, cache) + def initialize(cls, formatter, cache={}) + super(cls, formatter, cache) @type = :method @id = @cls.full_name + "-methods" @title = "Public Methods" @column_title = "Method" @row_class = "method-row" @short_params = ShortParams.new - @long_params = LongParams.new(@cls) - @formatter = DocFormatter.new() - @formatter.context = @cls.full_name - @formatter.css_class = 'docClass' - @formatter.url_template = 'output/%cls%.html' + @long_params = LongParams.new(@formatter) end def signature_suffix(item) @short_params.render(item[:params]) + " : " + item[:return][:type] end @@ -34,10 +30,10 @@ "</div>" ].join("\n") end def render_return(item) - type = item[:return][:type] + type = @formatter.replace(item[:return][:type]) doc = @formatter.format(item[:return][:doc]) if type == "void" && doc.length == 0 "<ul><li>void</li></ul>" else "<ul><li><code>#{type}</code><div class='sub-desc'>#{doc}</div></li></ul>"