class

Units::Measurement

Inherits Units::Scale < Comparable < Units::Compatible < Reference < Object

Constructors

new(value : BigDecimal, unit : Unit)
Source
new(value : Number | String, unit : Unit)
Source
new(value : Number | String, unit : String, mode : Mode = Mode::PrimaryCode)
Source
new(value : Measurement, unit : Unit)
Source

Instance methods

*(other : Measurement | Number)
Source
**(exponent : Number)
Source
+(other : Measurement)
Source
-(other : Measurement)
Source
/(other : Measurement | Number)
Source
==(other : Measurement)

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.

Source
abs(*args, **options)
Source
abs(*args, **options, &)
Source
abs2(*args, **options)
Source
abs2(*args, **options, &)
Source
ceil
Source
convert_to(other_unit : Unit)
Source
convert_to(other_unit : String, search : Mode = Mode::PrimaryCode)
Source
convert_to(other_unit : Scale)
Source
converted_value(other_unit : Unit)
Source
divmod(*args, **options)
Source
divmod(*args, **options, &)
Source
floor
Source
format(*args, **options)
Source
format(*args, **options, &)
Source
humanize(*args, **options)
Source
humanize(*args, **options, &)
Source
operate(operator : Operation, other : Number) : Measurement
Source
operate(operator : Operation, other : Measurement) : Measurement
Source
round(*args, **options)
Source
round(*args, **options, &)
Source
sign(*args, **options)
Source
sign(*args, **options, &)
Source
significant(*args, **options)
Source
significant(*args, **options, &)
Source
to_big_d(*args, **options)
Source
to_big_d(*args, **options, &)
Source
to_big_f(*args, **options)
Source
to_big_f(*args, **options, &)
Source
to_big_i(*args, **options)
Source
to_big_i(*args, **options, &)
Source
to_big_r(*args, **options)
Source
to_big_r(*args, **options, &)
Source
to_f(*args, **options)
Source
to_f(*args, **options, &)
Source
to_f!(*args, **options)
Source
to_f!(*args, **options, &)
Source
to_f32(*args, **options)
Source
to_f32(*args, **options, &)
Source
to_f32!(*args, **options)
Source
to_f32!(*args, **options, &)
Source
to_f64(*args, **options)
Source
to_f64(*args, **options, &)
Source
to_f64!(*args, **options)
Source
to_f64!(*args, **options, &)
Source
to_i(*args, **options)
Source
to_i(*args, **options, &)
Source
to_i!(*args, **options)
Source
to_i!(*args, **options, &)
Source
to_i16(*args, **options)
Source
to_i16(*args, **options, &)
Source
to_i16!(*args, **options)
Source
to_i16!(*args, **options, &)
Source
to_i32(*args, **options)
Source
to_i32(*args, **options, &)
Source
to_i32!(*args, **options)
Source
to_i32!(*args, **options, &)
Source
to_i64(*args, **options)
Source
to_i64(*args, **options, &)
Source
to_i64!(*args, **options)
Source
to_i64!(*args, **options, &)
Source
to_i8(*args, **options)
Source
to_i8(*args, **options, &)
Source
to_i8!(*args, **options)
Source
to_i8!(*args, **options, &)
Source
to_u(*args, **options)
Source
to_u(*args, **options, &)
Source
to_u!(*args, **options)
Source
to_u!(*args, **options, &)
Source
to_u16(*args, **options)
Source
to_u16(*args, **options, &)
Source
to_u16!(*args, **options)
Source
to_u16!(*args, **options, &)
Source
to_u32(*args, **options)
Source
to_u32(*args, **options, &)
Source
to_u32!(*args, **options)
Source
to_u32!(*args, **options, &)
Source
to_u64(*args, **options)
Source
to_u64(*args, **options, &)
Source
to_u64!(*args, **options)
Source
to_u64!(*args, **options, &)
Source
to_u8(*args, **options)
Source
to_u8(*args, **options, &)
Source
to_u8!(*args, **options)
Source
to_u8!(*args, **options, &)
Source
zero?(*args, **options)
Source
zero?(*args, **options, &)
Source