def primary_code : String
#
struct Units::Atom
- Units::Atom
- Struct
- Value
- Object
Included Modules
- Comparable(Units::Atom)
- Units::Compatible
Defined in:
units/atom.crConstructors
Class Method Summary
Instance Method Summary
- #arbitrary? : Bool
- #base?
- #depth : Int32
- #derived?
- #dimension
- #magnitude(scalar = nil)
- #metric? : Bool
- #name : Array(String)
- #primary_code : String
- #property : String
- #register
- #root_terms : Array(Term)
-
#scalar(magnitude = 1)
Get a numeric value that can be used to with other atoms to compare with or operate on.
- #scale : Scale
- #scale? : Scale | Nil
- #secondary_code : String
- #special? : Bool
- #symbol : String | Nil
- #terminal?
-
#to_s(mode : Mode = Mode::PrimaryCode)
Returns a nicely readable and concise string representation of this object, typically intended for users.
Instance methods inherited from module Units::Compatible
<=>(other)
<=>,
compatible_with?(other)
compatible_with?,
composition : Multiset(String)
composition,
composition_string : String
composition_string,
dimension
dimension
Constructor Detail
def self.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)
#
Class Method Detail
Instance Method Detail
def 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.
Description copied from class Object
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
.