Module: Unity::Dimension

Extended by:
Dimension
Included in:
Dimension
Defined in:
lib/unity/dimension.rb,
lib/unity/dimension/vector.rb,
lib/unity/dimension/integer.rb

Defined Under Namespace

Modules: Integer, Vector

Constant Summary collapse

LIST =

0 length meter 1 time second 2 temperature kelvin 3 mass kilogram 4 current ampere 5 substance mole 6 luminosity candela 7 money pound

[:length, :time, :temperature, :mass, :current, :substance, :luminosity, :money]
UNITS =
['meter', 'second', 'kelvin', 'kilogram', 'ampere', 'mole', 'candela', 'pound']
INDICIES =
DIMSIZES =
[20, 20, 20, 10, 10, 10, 10, 10]
DIMVALS =
[1, 20, 400, 8000, 80000, 800000, 8000000, 80000000]

Instance Method Summary collapse

Instance Method Details

#blank_dimension_vectorObject



28
29
30
# File 'lib/unity/dimension.rb', line 28

def blank_dimension_vector
  Array.new(LIST.length, 0)
end

#si_unit(dimension) ⇒ Object



24
25
26
# File 'lib/unity/dimension.rb', line 24

def si_unit dimension
  UNITS[INDICIES[dimension.to_sym]]
end