ciris.squants.squants.scala Maven / Gradle / Ivy
The newest version!
/*
* Copyright 2017-2024 Viktor Rudebeck
*
* SPDX-License-Identifier: MIT
*/
package ciris
import _root_.squants.{Dimension, Quantity}
package object squants {
implicit final def stringQuantityConfigDecoder[A <: Quantity[A]](
implicit dimension: Dimension[A]
): ConfigDecoder[String, A] =
ConfigDecoder[String].mapOption(dimension.name) { s => dimension.parseString(s).toOption }
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy