diff --git a/src/main/kotlin/me/deotime/kpoetdsl/Attributes.kt b/src/main/kotlin/me/deotime/kpoetdsl/Attributes.kt index 14d3f7c..04f0a37 100644 --- a/src/main/kotlin/me/deotime/kpoetdsl/Attributes.kt +++ b/src/main/kotlin/me/deotime/kpoetdsl/Attributes.kt @@ -70,6 +70,7 @@ interface Attributes { interface Properties : Has { fun property(assembler: Assembler) + fun property(name: String, assembler: Assembler) } interface Code : Has { @@ -133,9 +134,12 @@ interface Attributes { ): Has.Properties = object : Has.Properties, Sourced by sourcedByCozy(cozy) { override fun property(assembler: Assembler) { - holder(source).add(PropertyBuilder.cozy().buildWith(assembler)) } + + override fun property(name: String, assembler: Assembler) { + holder(source).add(PropertyBuilder.cozy().apply { name(name) }.buildWith(assembler)) + } } @JvmName("propertyVisitor_typed")