def method_name
name = nil
[:method, :attribute, :overload].each do |tag_name|
if tag = @docstring.tag(tag_name)
name = tag.send(tag_name == :attribute ? :text : :name).to_s
if tag_name == :method && name =~ /\(|\s/
overload = Tags::OverloadTag.new(:overload, name)
@docstring.add_tag(overload)
end
break
end
end
name = nil if name =~ /\A\s*\Z/
name ||= call_params.first
return unless name
return unless name =~ /^#{METHODNAMEMATCH}(\s|\(|$)/
if name =~ /\A\s*([^\(; \t]+)/
name = $1
end
if @docstring.tag(:attribute) && !attribute_readable?
name = name + '='
end
name
end