primary_code
SourceUnits::Atom
Inherits Comparable < Units::Compatible < Struct < Value < Object
Constructors
new(name : String | Array(String), symbol : Nil | String, primary_code : String, secondary_code : String, property : String, scale : Units::Scale | Nil = nil, metric : Bool = true, special : Bool = false, arbitrary : Bool = false, dimension : Nil | String = nil, classification : Nil | String = nil)
SourceClass methods
all
Sourceregister(atom : Atom)
SourceInstance methods
arbitrary?
Sourcebase?
Sourcedepth
Sourcederived?
Sourcedimension
Sourcemagnitude(scalar = nil)
Sourcemetric?
Sourcename
Sourceproperty
Sourceregister
Sourceroot_terms
Sourcescalar(magnitude = 1)
Get a numeric value that can be used to with other atoms to compare with or operate on. Base units have a scalar of 1.
scale
Sourcescale?
Sourcesecondary_code
Sourcespecial?
Sourcesymbol
Sourceterminal?
Sourceto_s(mode : Mode = Mode::PrimaryCode)
Returns a nicely readable and concise string representation of this object, typically intended for users.
This method should usually not be overridden. It delegates to
#to_s(IO) which can be overridden for custom implementations.
Also see #inspect.