Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
BuildTools authored and BuildTools committed Dec 20, 2022
1 parent bf268ad commit 61d9130
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/kotlin/me/deotime/kpoetdsl/Attributes.kt
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ interface Attributes {

interface Properties : Has {
fun property(assembler: Assembler<PropertyBuilder>)
fun property(name: String, assembler: Assembler<PropertyBuilder>)
}

interface Code : Has {
Expand Down Expand Up @@ -133,9 +134,12 @@ interface Attributes {
): Has.Properties =
object : Has.Properties, Sourced<S> by sourcedByCozy(cozy) {
override fun property(assembler: Assembler<PropertyBuilder>) {

holder(source).add(PropertyBuilder.cozy().buildWith(assembler))
}

override fun property(name: String, assembler: Assembler<PropertyBuilder>) {
holder(source).add(PropertyBuilder.cozy().apply { name(name) }.buildWith(assembler))
}
}

@JvmName("propertyVisitor_typed")
Expand Down

0 comments on commit 61d9130

Please sign in to comment.