struct

Units::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)
Source

Class methods

find(string : String, method : Mode = Mode::PrimaryCode)
Source
register(atom : Atom)
Source

Instance methods

arbitrary?
Source
base?
Source
depth
Source
derived?
Source
dimension
Source
magnitude(scalar = nil)
Source
metric?
Source
name
Source
primary_code
Source
property
Source
register
Source
root_terms
Source
scalar(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.

Source
scale
Source
scale?
Source
secondary_code
Source
special?
Source
symbol
Source
terminal?
Source
to_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.

Source