lib/yard/templates/helpers/html_helper.rb in yard-0.8.7.6 vs lib/yard/templates/helpers/html_helper.rb in yard-0.9.0
- old
+ new
@@ -460,11 +460,11 @@
type = link ? h(types.join(", ")) : format_types(types, false)
end
elsif !type.empty?
type = link ? h(type) : format_types([type], false)
end
- type = "(#{type}) " unless type.empty?
+ type = "#{type} " unless type.empty?
type
end
# Formats the signature of method +meth+.
#
@@ -477,11 +477,12 @@
# @return [String] the formatted method signature
def signature(meth, link = true, show_extras = true, full_attr_name = true)
meth = convert_method_to_overload(meth)
type = signature_types(meth, link)
- scope = meth.scope == :class ? "+" : "-"
+ type = "⇒ #{type}" if type && !type.empty?
+ scope = meth.scope == :class ? "." : "#"
name = full_attr_name ? meth.name : meth.name.to_s.gsub(/^(\w+)=$/, '\1')
blk = format_block(meth)
args = !full_attr_name && meth.writer? ? "" : format_args(meth)
extras = []
extras_text = ''
@@ -492,10 +493,10 @@
extras << attname if attname
end
extras << meth.visibility if meth.visibility != :public
extras_text = ' <span class="extras">(' + extras.join(", ") + ')</span>' unless extras.empty?
end
- title = "%s %s<strong>%s</strong>%s %s" % [scope, type, h(name), args, blk]
+ title = "%s<strong>%s</strong>%s %s %s" % [scope, h(name), args, blk, type]
if link
if meth.is_a?(YARD::CodeObjects::MethodObject)
link_title = "#{h meth.name(true)} (#{meth.scope} #{meth.type})"
else
link_title = "#{h name} (#{meth.type})"