Specification invoke made inline
This commit is contained in:
parent
5c3d51de58
commit
66cee2d42b
@ -17,8 +17,6 @@ interface Specification<T : Configurable> {
|
||||
return wrap(config).apply(action)
|
||||
}
|
||||
|
||||
operator fun invoke(action: T.() -> Unit) = empty().apply(action)
|
||||
|
||||
fun empty() = wrap()
|
||||
|
||||
/**
|
||||
@ -37,6 +35,8 @@ interface Specification<T : Configurable> {
|
||||
fun wrap(default: Meta): T = wrap(Config()) { default[it] }
|
||||
}
|
||||
|
||||
inline operator fun <T : Configurable> Specification<T>.invoke(action: T.() -> Unit) = empty().apply(action)
|
||||
|
||||
/**
|
||||
* Apply specified configuration to configurable
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user