Class: Convertable::Units::SquareFoot

Inherits:
SimpleUnit
  • Object
show all
Defined in:
lib/convertable/units.rb

Class Method Summary collapse

Methods inherited from SimpleUnit

to_json

Class Method Details

.convert_to(magnitude, new_unit) ⇒ Object



25
26
27
28
29
30
31
32
33
# File 'lib/convertable/units.rb', line 25

def self.convert_to(magnitude, new_unit)
  if new_unit == SquareFoot
    magnitude
  elsif new_unit == SquareMeter
    magnitude / 10.7639
  else
    raise UnsupportedConversion
  end
end