class Units::Measurement

Defined in:

units/measurement.cr

Constructors

Instance Method Summary

Instance methods inherited from class Units::Scale

atoms(*args, **options)
atoms(*args, **options, &)
atoms
, depth : Int32 depth, inspect(io : IO) : Nil inspect, magnitude(scalar = scalar()) magnitude, mode : Mode mode, root_terms : Array(Term) root_terms, scalar(magnitude = value) scalar, special?(*args, **options)
special?(*args, **options, &)
special?
, terms(*args, **options)
terms(*args, **options, &)
terms
, to_s(io, mode : Mode = @mode) : Nil to_s, unit : Unit unit, value : BigDecimal value

Constructor methods inherited from class Units::Scale

new(function_code : String | ScaleFunction::FunctionSelection, value : Number | String, unit : String, search : Mode = Mode::PrimaryCode)
new(value : BigDecimal, unit : Unit = Unit.new)
new(value : BigDecimal, unit : String, mode : Mode = Mode::PrimaryCode)
new(value : Number | String, unit : Unit = Unit.new)
new(value : Number | String, unit : String, mode : Mode = Mode::PrimaryCode)
new(function_code : String | ScaleFunction::FunctionSelection, value : Number | String, unit : Unit = Unit.new)
new

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(value : BigDecimal, unit : Unit) #

[View source]
def self.new(value : Number | String, unit : Unit) #

[View source]
def self.new(value : Number | String, unit : String, mode : Mode = Mode::PrimaryCode) #

[View source]
def self.new(value : Measurement, unit : Unit) #

[View source]

Instance Method Detail

def *(other : Measurement | Number) #

[View source]
def **(exponent : Number) #

[View source]
def +(other : Measurement) #

[View source]
def -(other : Measurement) #

[View source]
def /(other : Measurement | Number) #

[View source]
def ==(other : Measurement) #
Description copied from module Comparable(Units::Scale)

Compares this object to other based on the receiver’s <=> method, returning true if it returns 0.

Also returns true if this and other are the same object.


[View source]
def abs(*args, **options) #

[View source]
def abs(*args, **options, &) #

[View source]
def abs2(*args, **options) #

[View source]
def abs2(*args, **options, &) #

[View source]
def ceil #

[View source]
def convert_to(other_unit : Unit) #

[View source]
def convert_to(other_unit : String, search : Mode = Mode::PrimaryCode) #

[View source]
def convert_to(other_unit : Scale) #

[View source]
def converted_value(other_unit : Unit) #

[View source]
def divmod(*args, **options) #

[View source]
def divmod(*args, **options, &) #

[View source]
def floor #

[View source]
def format(*args, **options) #

[View source]
def format(*args, **options, &) #

[View source]
def humanize(*args, **options) #

[View source]
def humanize(*args, **options, &) #

[View source]
def operate(operator : Operation, other : Number) : Measurement #

[View source]
def operate(operator : Operation, other : Measurement) : Measurement #

[View source]
def round(*args, **options) #

[View source]
def round(*args, **options, &) #

[View source]
def sign(*args, **options) #

[View source]
def sign(*args, **options, &) #

[View source]
def significant(*args, **options) #

[View source]
def significant(*args, **options, &) #

[View source]
def to_big_d(*args, **options) #

[View source]
def to_big_d(*args, **options, &) #

[View source]
def to_big_f(*args, **options) #

[View source]
def to_big_f(*args, **options, &) #

[View source]
def to_big_i(*args, **options) #

[View source]
def to_big_i(*args, **options, &) #

[View source]
def to_big_r(*args, **options) #

[View source]
def to_big_r(*args, **options, &) #

[View source]
def to_f(*args, **options) #

[View source]
def to_f(*args, **options, &) #

[View source]
def to_f!(*args, **options) #

[View source]
def to_f!(*args, **options, &) #

[View source]
def to_f32(*args, **options) #

[View source]
def to_f32(*args, **options, &) #

[View source]
def to_f32!(*args, **options) #

[View source]
def to_f32!(*args, **options, &) #

[View source]
def to_f64(*args, **options) #

[View source]
def to_f64(*args, **options, &) #

[View source]
def to_f64!(*args, **options) #

[View source]
def to_f64!(*args, **options, &) #

[View source]
def to_i(*args, **options) #

[View source]
def to_i(*args, **options, &) #

[View source]
def to_i!(*args, **options) #

[View source]
def to_i!(*args, **options, &) #

[View source]
def to_i16(*args, **options) #

[View source]
def to_i16(*args, **options, &) #

[View source]
def to_i16!(*args, **options) #

[View source]
def to_i16!(*args, **options, &) #

[View source]
def to_i32(*args, **options) #

[View source]
def to_i32(*args, **options, &) #

[View source]
def to_i32!(*args, **options) #

[View source]
def to_i32!(*args, **options, &) #

[View source]
def to_i64(*args, **options) #

[View source]
def to_i64(*args, **options, &) #

[View source]
def to_i64!(*args, **options) #

[View source]
def to_i64!(*args, **options, &) #

[View source]
def to_i8(*args, **options) #

[View source]
def to_i8(*args, **options, &) #

[View source]
def to_i8!(*args, **options) #

[View source]
def to_i8!(*args, **options, &) #

[View source]
def to_u(*args, **options) #

[View source]
def to_u(*args, **options, &) #

[View source]
def to_u!(*args, **options) #

[View source]
def to_u!(*args, **options, &) #

[View source]
def to_u16(*args, **options) #

[View source]
def to_u16(*args, **options, &) #

[View source]
def to_u16!(*args, **options) #

[View source]
def to_u16!(*args, **options, &) #

[View source]
def to_u32(*args, **options) #

[View source]
def to_u32(*args, **options, &) #

[View source]
def to_u32!(*args, **options) #

[View source]
def to_u32!(*args, **options, &) #

[View source]
def to_u64(*args, **options) #

[View source]
def to_u64(*args, **options, &) #

[View source]
def to_u64!(*args, **options) #

[View source]
def to_u64!(*args, **options, &) #

[View source]
def to_u8(*args, **options) #

[View source]
def to_u8(*args, **options, &) #

[View source]
def to_u8!(*args, **options) #

[View source]
def to_u8!(*args, **options, &) #

[View source]
def zero?(*args, **options) #

[View source]
def zero?(*args, **options, &) #

[View source]