diff options
| -rw-r--r-- | lib/yard/mruby/templates/helpers/html_helper.rb | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/lib/yard/mruby/templates/helpers/html_helper.rb b/lib/yard/mruby/templates/helpers/html_helper.rb index 7d1e159..232cad1 100644 --- a/lib/yard/mruby/templates/helpers/html_helper.rb +++ b/lib/yard/mruby/templates/helpers/html_helper.rb @@ -5,9 +5,19 @@ module YARD::MRuby::Templates def fsignature(func, link = true, show_extras = true) name = func.name - prefix = 'void' - params = 'void' - title = "%s <strong>%s</strong>( %s )" % [h(prefix), h(name), h(params)] + prefix = func.return_type || 'void' + params = if func.parameter_types.empty? + 'void' + else + func.parameter_types.map do |t| + if show_extras + [t.type, t.name].join(' ') + else + t.type + end + end.join(', ') + end + title = "%s <strong>%s</strong>(%s)" % [h(prefix), h(name), h(params)] if link url = url_for(func) |
