Class Eymiha::UnitsHash
In: lib/eymiha/units/units_hash.rb
Parent: Hash

The unit part of a NumericWithUnits is a UnitsHash - a Hash from UnitsUnit instances to powers.

Methods

*   **   debug=   derived?   has_units?   measure   merge   merge!   new   power!   reduce   to_s  

Public Class methods

Public Instance methods

*(value,power=1)

Alias for merge

Returns a new UnitsHash whose value is the instance raised to the given power.

Returns true is any of the instance‘s components are derived.

Return true if the instance is not equal to 1, ie. has at least one non-zero exponent.

Returns the UnitsMeasure of the instance if defined.

Returns a new UnitsHash whose value is the instance‘s units and powers have been merged with the given value raised to the power.

Merges and returns the instance after the value raised to the power has been merged into it.

Raises and returns the instance after each of its exponents has been raised by the given power.

Return a NumericWithUnits that represents the instance when all derived units have been replaced with the units from which they derive.

Returns a String reprentation of the instance. If there is only one item in the UnitsHash, whole names are rendered; otherwise abbreviations are used.

[Validate]