@@ -12,9 +12,11 @@ extension FileGenerator {
1212 static func generateFileContentWith( _ modelFile: ModelFile , configuration: ModelGenerationConfiguration ) -> String {
1313 var content = try ! loadFileWith ( " BaseTemplate " )
1414 let singleTab = " " , doubleTab = " "
15+ let accessPrefix = modelFile. accessControl. declarationPrefix
1516 content = content. replacingOccurrences ( of: " {OBJECT_NAME} " , with: modelFile. fileName)
1617 content = content. replacingOccurrences ( of: " {DATE} " , with: todayDateString ( ) )
1718 content = content. replacingOccurrences ( of: " {OBJECT_KIND} " , with: modelFile. type. rawValue)
19+ content = content. replacingOccurrences ( of: " {ACCESS_CONTROL} " , with: accessPrefix)
1820
1921 if let authorName = configuration. authorName {
2022 content = content. replacingOccurrences ( of: " __NAME__ " , with: authorName)
@@ -36,7 +38,7 @@ extension FileGenerator {
3638 if modelFile. configuration? . shouldGenerateInitMethod == true {
3739 let assignment = modelFile. component. initialiserFunctionComponent. map { doubleTab + $0. assignmentString } . joined ( separator: " \n " )
3840 let functionParameters = modelFile. component. initialiserFunctionComponent. map { $0. functionParameter } . joined ( separator: " , " )
39- let initialiserFunctionStatement = " \n \( singleTab) init ( \( functionParameters) ) { "
41+ let initialiserFunctionStatement = " \n \( singleTab) \( accessPrefix ) init ( \( functionParameters) ) { "
4042 content = content. replacingOccurrences ( of: " {INITIALIZER_FUNCTION_DECLRATION} " , with: initialiserFunctionStatement)
4143 content = content. replacingOccurrences ( of: " {INITIALISER_FUNCTION_ASSIGNMENT} " , with: assignment)
4244 content = content. replacingOccurrences ( of: " {INITIALISER_FUNCTION_END} " , with: " \( singleTab) } \n " )
0 commit comments