Class Numeric
In: lib/eymiha/units/numeric.rb
Parent: Object

Numerics are extended to allow them to be united with units.

Part of this extension is in the added dynamism of the class. During unit definition, if an unencountered unit is referenced, the use is held until more information is loaded into the system and the unknown unit has been resolved. During use, unencountered units are raised.

Methods

unite  

External Aliases

method_missing -> method_missing_before_units

Public Instance methods

Returns a NumericWithUnits whose numeric value is the value of the instance, and whose unit is determined from the provided unit and power in the context of a given measure:

  • as a String or Symbol equal to the singular, plural or abbreviated name of a unit,
  • as a UnitsHash,
  • as the unit part of a NumericWithUnits,
  • as an Array of any of the above.

[Validate]