def format_types(list, brackets = true)
      list.nil? || list.empty? ? "" : (brackets ? "(#{list.join(", ")})" : list.join(", "))
    end
def format_types(list, brackets = true)
      list.nil? || list.empty? ? "" : (brackets ? "(#{list.join(", ")})" : list.join(", "))
    end
@group Formatting Object Attributes
 Formats a list of return types for output and links each type.

 @example Formatting types
   format_types(['String', 'Array']) #=> "(String, Array)"
 @example Formatting types without surrounding brackets
   format_types(['String', 'Array'], false) #=> "String, Array"
 @param [Array<String>] list a list of types
 @param [Boolean] brackets whether to surround the types in brackets
 @return [String] the formatted list of Ruby types