struct

Jane::Threshold

Inherits Struct < Value < Object

Constructors

new(value : Float64, unit : Symbol)
Source
parse(str : String) : Threshold

Parse string format like "2%", "200mb", "300gb"

Source

Class methods

from_toml(data : TOML::Any, key : String) : Array(Threshold)

Parse from TOML nested structure like usage.pct, usage.gb, etc. Returns an array of thresholds (supports array values like usage.pct = [5,20,30]).

Source

Instance methods

format_value
Source
to_bytes
Source
to_gb
Source
to_percent
Source
unit
Source
unit=(unit : Symbol)
Source
value
Source
value=(value : Float64)
Source