lib/quantify/unit/compound_base_unit.rb
# Container class for compound unit base units. Each instance is represented
# by a unit and an index, i.e. a unit raised to some power. If no index is
# present, 1 is assumed.
#
# Instances of this class can be used to initialize base units, and are the
# structures which hold base units within compound units
#
Container class for compound unit base units. Each instance is represented
by a unit and an index, i.e. a unit raised to some power. If no index is
present, 1 is assumed.

Instances of this class can be used to initialize base units, and are the
structures which hold base units within compound units
Container class for compound unit base units . Each instance is represented by a unit and an index i . e . a unit raised to some power . If no index is present 1 is assumed . Instances of this class can be used to initialize base units and are the structures which hold base units within compound units
def name_to_power(string,index)
        name = string.clone
        case index
        when 1 then name
        when 2 then "square #{name}"
        when 3 then "cubic #{name}"
        else
          ordinal = ActiveSupport::Inflector.ordinalize(index)
          name << " to the #{ordinal} power"
        end
      end
def name_to_power ( string , index ) name = string . clone case index when 1 then name when 2 then "square #{name}" when 3 then "cubic #{name}" else ordinal = ActiveSupport :: Inflector . ordinalize ( index ) name << " to the #{ordinal} power" end end
Container class for compound unit base units.
Container class for compound unit base units .
string
<not_specific>
index
<not_specific>