struct

Units::Unit

Inherits Comparable < Units::Compatible < Struct < Value < Object

Constructors

new(terms : Array(Term) = [] of Term)
Source
new(term : Term)
Source
new(unit : String, search : Mode = Mode::PrimaryCode)
Source

Instance methods

*(other : Unit | Term | Number)
Source
**(other : Number) : Unit
Source
/(other : Unit | Term | Number)
Source
atoms
Source
depth
Source
magnitude(scalar = scalar()) : BigDecimal
Source
operate(operator : Operation, other : Unit | Term | Number) : Unit
Source
root_terms
Source
scalar(magnitude : Number = 1) : BigDecimal
Source
special?
Source
terms
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
to_s(io : IO) : Nil

Same as #inspect(io).

Source