Loading lib/jsduck.rb +1 −1 Original line number Diff line number Diff line Loading @@ -10,7 +10,7 @@ require 'jsduck/doc_links' require 'jsduck/table' require 'jsduck/cfg_table' require 'jsduck/property_table' require 'jsduck/param_list' require 'jsduck/short_params' require 'jsduck/method_table' require 'jsduck/event_table' require 'jsduck/page' Loading lib/jsduck/event_table.rb +2 −2 Original line number Diff line number Diff line Loading @@ -8,11 +8,11 @@ module JsDuck @title = "Public Events" @column_title = "Event" @row_class = "method-row" @param_list = ParamList.new @short_params = ShortParams.new end def signature_suffix(item) " : " + @param_list.short(item[:params]) " : " + @short_params.render(item[:params]) end end Loading lib/jsduck/method_table.rb +2 −2 Original line number Diff line number Diff line Loading @@ -8,11 +8,11 @@ module JsDuck @title = "Public Methods" @column_title = "Method" @row_class = "method-row" @param_list = ParamList.new @short_params = ShortParams.new end def signature_suffix(item) @param_list.short(item[:params]) + " : " + return_type(item) @short_params.render(item[:params]) + " : " + return_type(item) end def return_type(item) Loading lib/jsduck/param_list.rb→lib/jsduck/short_params.rb +6 −6 Original line number Diff line number Diff line module JsDuck # Renders method/event parameter lists class ParamList # Creates short parameters list used in signatures. def short(params) # Renders method/event parameters list in short form # for use in signatures class ShortParams def render(params) if params.length > 0 "( " + params.collect {|p| format_short(p) }.join(", ") + " )" "( " + params.collect {|p| render_single(p) }.join(", ") + " )" else "()" end end def format_short(param) def render_single(param) type = param[:type] || "Object" name = param[:name] || "" str = "<code>#{type} #{name}</code>" Loading Loading
lib/jsduck.rb +1 −1 Original line number Diff line number Diff line Loading @@ -10,7 +10,7 @@ require 'jsduck/doc_links' require 'jsduck/table' require 'jsduck/cfg_table' require 'jsduck/property_table' require 'jsduck/param_list' require 'jsduck/short_params' require 'jsduck/method_table' require 'jsduck/event_table' require 'jsduck/page' Loading
lib/jsduck/event_table.rb +2 −2 Original line number Diff line number Diff line Loading @@ -8,11 +8,11 @@ module JsDuck @title = "Public Events" @column_title = "Event" @row_class = "method-row" @param_list = ParamList.new @short_params = ShortParams.new end def signature_suffix(item) " : " + @param_list.short(item[:params]) " : " + @short_params.render(item[:params]) end end Loading
lib/jsduck/method_table.rb +2 −2 Original line number Diff line number Diff line Loading @@ -8,11 +8,11 @@ module JsDuck @title = "Public Methods" @column_title = "Method" @row_class = "method-row" @param_list = ParamList.new @short_params = ShortParams.new end def signature_suffix(item) @param_list.short(item[:params]) + " : " + return_type(item) @short_params.render(item[:params]) + " : " + return_type(item) end def return_type(item) Loading
lib/jsduck/param_list.rb→lib/jsduck/short_params.rb +6 −6 Original line number Diff line number Diff line module JsDuck # Renders method/event parameter lists class ParamList # Creates short parameters list used in signatures. def short(params) # Renders method/event parameters list in short form # for use in signatures class ShortParams def render(params) if params.length > 0 "( " + params.collect {|p| format_short(p) }.join(", ") + " )" "( " + params.collect {|p| render_single(p) }.join(", ") + " )" else "()" end end def format_short(param) def render_single(param) type = param[:type] || "Object" name = param[:name] || "" str = "<code>#{type} #{name}</code>" Loading