    # File lib/yard/templates/engine.rb, line 114
            def with_serializer(object, serializer, &block)
              output = nil
              filename = serializer.serialized_path(object)
              if serializer.respond_to?(:basepath)
                filename = File.join(serializer.basepath, filename)
              end
              log.capture("Generating #{filename}", nil) do
                serializer.before_serialize if serializer
                output = yield
                if serializer
                  serializer.serialize(object, output)
                  serializer.after_serialize(output)
                end
              end
              output
            end