fromYaml

fun KbEnvironment.Companion.fromYaml(yaml: String, clock: Clock = Clock.System, configure: KbEnvironmentBuilder.() -> Unit = {}): KbEnvironment(source)

Creates a new KbEnvironment by parsing yaml as a YAML map, bridging it to a KpaStruct via asKpaStruct, and using the struct as the context.

Return

a new KbEnvironment.

Parameters

yaml

the YAML string; must parse to a YAML map.

clock

the clock used to seed the default now environment property; defaults to Clock.System.

configure

a DSL lambda for registering transforms and properties on the environment.

Throws

SerializationException

if yaml does not parse to a YAML map.