Skip to content

Commit 7a43d27

Browse files
Merge remote-tracking branch 'origin/feat/add-yml-config-wrapper' into feat/add-yml-config-wrapper
2 parents 0ec3503 + 19911ab commit 7a43d27

File tree

1 file changed

+6
-2
lines changed
  • surf-api-core/surf-api-core-api/src/main/kotlin/dev/slne/surf/surfapi/core/api/config

1 file changed

+6
-2
lines changed

surf-api-core/surf-api-core-api/src/main/kotlin/dev/slne/surf/surfapi/core/api/config/YmlConfigWrapper.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,12 @@ import kotlin.reflect.KClass
1313
* @param configFolder The folder where the configuration file is located.
1414
* @param fileName The name of the configuration file in YAML format.
1515
*
16-
* Use in your main: val myConfig = surfConfigApi.createYmlConfig<MyConfigClass>(configFolderPath)
16+
* Example usage:
17+
* ```
18+
* import dev.slne.surf.surfapi.core.api.config.surfConfigApi
19+
*
20+
* val myConfig = surfConfigApi.createYmlConfig<MyConfigClass>(configFolderPath)
21+
* ```
1722
*/
1823
class YmlConfigWrapper<T : Any>(
1924
private val clazz: KClass<T>,
@@ -60,7 +65,6 @@ class YmlConfigWrapper<T : Any>(
6065
* @param block A lambda function defining the modifications to be applied to the configuration object.
6166
*/
6267
fun edit(save: Boolean = true, block: T.() -> Unit) {
63-
val config = config
6468
config.block()
6569

6670
if (save) {

0 commit comments

Comments
 (0)