func render()

in Sources/MockoloFramework/Models/VariableModel.swift [75:135]


    func render(
        context: RenderContext,
        arguments: GenerationArguments
    ) -> String? {
        guard let enclosingType = context.enclosingType else {
            return nil
        }
        let shouldOverride = context.annotatedTypeKind == .class
        if processed {
            guard let modelDescription = modelDescription?.trimmingCharacters(in: .newlines), !modelDescription.isEmpty else {
                return nil
            }

            var prefix = ""
            if let propertyWrapper = propertyWrapper, !modelDescription.contains(propertyWrapper) {
                prefix = "\(propertyWrapper) "
            }
            if let type, shouldOverride, !name.isGenerated(type: type) {
                prefix += "\(String.override) "
            }

            return prefix + modelDescription
        }

        guard let type else {
            return nil
        }

        if !arguments.disableCombineDefaultValues {
            if let combineVar = applyCombineVariableTemplate(name: name,
                                                             type: type,
                                                             encloser: enclosingType.typeName,
                                                             shouldOverride: shouldOverride,
                                                             isStatic: isStatic,
                                                             accessLevel: accessLevel) {
                return combineVar
            }
        }

        if let rxVar = applyRxVariableTemplate(name: name,
                                               type: type,
                                               encloser: enclosingType.typeName,
                                               rxTypes: rxTypes,
                                               shouldOverride: shouldOverride,
                                               allowSetCallCount: arguments.allowSetCallCount,
                                               isStatic: isStatic,
                                               accessLevel: accessLevel) {
            return rxVar
        }

        return applyVariableTemplate(name: name,
                                     type: type,
                                     encloser: enclosingType.typeName,
                                     isStatic: isStatic,
                                     customModifiers: customModifiers,
                                     allowSetCallCount: arguments.allowSetCallCount,
                                     shouldOverride: shouldOverride,
                                     accessLevel: accessLevel,
                                     context: context,
                                     arguments: arguments)
    }