Class | Eymiha::Units |
In: |
lib/eymiha/units/units.rb
|
Parent: | Object |
The Units framework
Units is the top level that you‘ll typically never have to deal with directly. While it provides a few chunks of general functionality such as getting defined units and ranking, most of its guts are devoted to defining new UnitsMeasures - unless you‘re setting up your own sets of specialized units, you will hardly know it‘s here.
Answers the question of whether a UnitsMeasure is being defined with the instance if true, or nil if false.
Returns an Array of UnitsUnit associated with a singular, plural or abbreviated name.
Given a Hash of units to raking weights, a set of samples, and optionally a block that returns rankings, returns an Array of units ordered by best weighted fit over the samples. Like golf, low scores rank best. In absence of a block, ranking is based on the number of unit values whose magnitudes are between 1 and 10.