Method: Unity::Lookup.compatible_units

Defined in:
lib/unity/lookup.rb

.compatible_units(int_or_sym_or_string) ⇒ Object



36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/unity/lookup.rb', line 36

def compatible_units int_or_sym_or_string
  int =
    if int_or_sym_or_string.is_a? Integer
      int_or_sym_or_string
    else
      tmp = find_property(int_or_sym_or_string)
      tmp.nil? ? nil : tmp.dimension_int
    end
  (@@unit_ints[int] || []).map do |key|
    get_object key
  end
end