diff options
| author | Seba Gamboa <[email protected]> | 2015-09-29 12:40:03 -0300 |
|---|---|---|
| committer | Seba Gamboa <[email protected]> | 2015-09-29 12:40:03 -0300 |
| commit | ce8524cff39a70d966dde518161441fd17a5a33a (patch) | |
| tree | 9c0427b896ad71a1aab8ac540c2394e1ab0f84f2 /lib | |
| parent | b8602d593eff73609e2f2682375f546f61b58f73 (diff) | |
| download | yard-mruby-ce8524cff39a70d966dde518161441fd17a5a33a.tar.gz yard-mruby-ce8524cff39a70d966dde518161441fd17a5a33a.zip | |
Fix function signature. #2
Diffstat (limited to 'lib')
| -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) |
