lib/supernova/numeric_extensions.rb in supernova-0.1.1 vs lib/supernova/numeric_extensions.rb in supernova-0.2.0
- old
+ new
@@ -1,28 +1,23 @@
Numeric.class_eval do
- KM_TO_METER = 1000.0
- MILE_TO_METER = 1609.3472
- DEG_TO_RADIAN = Math::PI / 180.0
- RADIAN_TO_REG = 1 / DEG_TO_RADIAN
-
def km
- self * KM_TO_METER
+ self * Supernova::KM_TO_METER
end
def meter
self.to_f
end
def mile
- self * MILE_TO_METER
+ self * Supernova::MILE_TO_METER
end
def to_radians
- self * DEG_TO_RADIAN
+ self * Supernova::DEG_TO_RADIAN
end
def to_deg
- self * RADIAN_TO_REG
+ self * Supernova::RADIAN_TO_REG
end
alias_method :miles, :mile
alias_method :kms, :km
alias_method :meters, :meter
\ No newline at end of file