unit_conversion 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/unit_conversion/version.rb +1 -1
- data/lib/unit_conversion.rb +24 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c8fd20a76f33a14330344aa12f6383134caa6f8d
|
|
4
|
+
data.tar.gz: 46e4d35ba0449a64d74ad0d8953f8934281f5f1d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1904cb889ad5535ef60986dd36e3968b2707ec10449cc397230ea99c342f7f9b6a5a944c59d3d5f9db61adcc0e25104fb67a5f0b6f45649a280bc2ae1251d7d7
|
|
7
|
+
data.tar.gz: 4e592e637eada6ba3fb710b5e80db775af0dd1f10f5d798bfd1b7453f11d8d0b3a9307e1d2b4fee16e47c93e79fc993863b00075cd2841fa9b37b9eb56111af9
|
data/lib/unit_conversion.rb
CHANGED
|
@@ -33,6 +33,30 @@ class UnitConversion
|
|
|
33
33
|
@measurement * 1.8
|
|
34
34
|
end
|
|
35
35
|
|
|
36
|
+
def celcius_to_fahrenheit
|
|
37
|
+
@measurement * 9/5 + 32.0
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def fahrenheit_to_celcius
|
|
41
|
+
(@measurement - 32.0) * 5/9
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
def celcius_to_rankine
|
|
45
|
+
(@measurement + 273.15) * 9/5
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def rankine_to_celcius
|
|
49
|
+
(@measurement - 491.67) * 5/9
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
def rankine_to_fahrenheit
|
|
53
|
+
@measurement - 459.67
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
def fahrenheit_to_rankine
|
|
57
|
+
@measurement + 459.67
|
|
58
|
+
end
|
|
59
|
+
|
|
36
60
|
########################
|
|
37
61
|
# DISTANCE CONVERSIONS #
|
|
38
62
|
########################
|