spells.DurationOpsModule.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spells_2.11 Show documentation
Show all versions of spells_2.11 Show documentation
This is a small scala "util" library, which will hopefully grow over time.
The newest version!
package spells
/** Provides utility methods for scala.concurrent.duration.Duration. */
trait DurationOpsModule {
this: CustomRenderingModule with HumanRenderingModule with StringOpsModule with SpellsConfigModule =>
import scala.concurrent.duration.Duration
implicit final class DurationOpsFromSpells(value: Duration) extends CustomRendering {
override final def rendered(implicit availableWidthInCharacters: StringOpsModule#AvailableWidthInCharacters = SpellsConfig.terminal.WidthInCharacters.value): String =
value.toNanos.render.duration.nanoseconds
}
}