I managed to get the default value for a resource with this (so that I can add something to the defaults):
define foo::bar($v) {}
Foo::Bar {
v => { 'foo' => 'bar' }
}
$a = parsejson(inline_template('<%= require "json"; scope.lookupdefaults("Foo::Bar")[:v].value.to_json %>'))
notice($a + { 'a' => 'b' })
It's quite clunky though, so I wonder if there's a better way.
↧