    # File lib/yard/serializers/file_system_serializer.rb, line 48
          def serialized_path(object)
            return object if object.is_a?(String)

            if object.is_a?(CodeObjects::ExtraFileObject)
              fspath = ['file.' + object.name + (extension.empty? ? '' : ".#{extension}")]
            else
              objname = object != YARD::Registry.root ? object.name.to_s : "top-level-namespace"
              objname += '_' + object.scope.to_s[0,1] if object.is_a?(CodeObjects::MethodObject)
              fspath = [objname + (extension.empty? ? '' : ".#{extension}")]
              if object.namespace && object.namespace.path != ""
                fspath.unshift(*object.namespace.path.split(CodeObjects::NSEP))
              end
            end

            File.join(encode_path_components(*fspath))
          end