unit_conversion 0.0.3 → 0.0.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c8fd20a76f33a14330344aa12f6383134caa6f8d
4
- data.tar.gz: 46e4d35ba0449a64d74ad0d8953f8934281f5f1d
3
+ metadata.gz: 8df1a3ed8f9596eab75d5680d9752c5072204cb9
4
+ data.tar.gz: 6de3609f36e72cd05b62b16a1b8aa3ce7c1bc292
5
5
  SHA512:
6
- metadata.gz: 1904cb889ad5535ef60986dd36e3968b2707ec10449cc397230ea99c342f7f9b6a5a944c59d3d5f9db61adcc0e25104fb67a5f0b6f45649a280bc2ae1251d7d7
7
- data.tar.gz: 4e592e637eada6ba3fb710b5e80db775af0dd1f10f5d798bfd1b7453f11d8d0b3a9307e1d2b4fee16e47c93e79fc993863b00075cd2841fa9b37b9eb56111af9
6
+ metadata.gz: a74b3fc2e020b3687d6891fba79ff3745a05da681c79b4b9ef7adc93c547fc9063a4edfbc8256c06a4f8eea6807307b984e3e676c3403b06c42b74d377f24892
7
+ data.tar.gz: f5860a5ee39a055c4c9eae2b61a95b5f53da84f404e099d098dadc07ffb7aea16adf96977623b1f92aefd7f03e2b9736894a7a2dc3ace4a39bb7e91dcf67d635
data/README.md CHANGED
@@ -49,9 +49,7 @@ Distance:
49
49
 
50
50
  ## Development
51
51
 
52
- I'll be adding more conversions along with a small group I'm working
53
- with. Feel free to watch this repo to keep up with what new conversions
54
- we add.
52
+ We'll be adding more conversions focusing on temperature conversions first. Feel free to email me suggestions if you want a certain conversion that isn't included in this gem.
55
53
 
56
54
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake rspec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
57
55
 
@@ -0,0 +1,2 @@
1
+ module TemperatureConversion
2
+ end
File without changes
@@ -1,3 +1,3 @@
1
1
  class UnitConversion
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -1,13 +1,13 @@
1
- require "unit_conversion/version"
1
+ require_relative "unit_conversion/version"
2
2
 
3
3
  class UnitConversion
4
4
  def initialize(measurement)
5
5
  @measurement = measurement
6
6
  end
7
-
8
- ###########################
9
- # TEMPERATURE CONVERSIONS #
10
- ###########################
7
+ #
8
+ ##########################
9
+ # TEMPERATURE CONVERSION #
10
+ ##########################
11
11
 
12
12
  def celcius_to_kelvin
13
13
  @measurement + 273.15
@@ -62,19 +62,19 @@ class UnitConversion
62
62
  ########################
63
63
 
64
64
  def feet_to_inch
65
- @measurement / 12.0
65
+ @measurement * 12.0
66
66
  end
67
67
 
68
68
  def inch_to_feet
69
- @measurement * 12.0
69
+ @measurement / 12.0
70
70
  end
71
71
 
72
72
  def feet_to_yard
73
- @measurement * 3.0
73
+ @measurement / 3.0
74
74
  end
75
75
 
76
76
  def yard_to_feet
77
- @measurement / 3.0
77
+ @measurement * 3.0
78
78
  end
79
79
 
80
80
  def feet_to_mile
@@ -85,11 +85,28 @@ class UnitConversion
85
85
  @measurement * 5280.0
86
86
  end
87
87
 
88
+ def meter_to_feet
89
+ @measurement / 0.3048
90
+ end
91
+
88
92
  def feet_to_meter
89
93
  @measurement * 0.3048
90
94
  end
91
95
 
92
- def meter_to_feet
93
- @measurement / 0.3048
96
+ #
97
+ def inch_to_meter
98
+ @measurement * 0.0254
99
+ end
100
+
101
+ def meter_to_inch
102
+ @measurement / 0.0254
103
+ end
104
+
105
+ def yard_to_meter
106
+ @measurement * 0.9144
107
+ end
108
+
109
+ def meter_to_yard
110
+ @measurement / 0.9144
94
111
  end
95
112
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unit_conversion
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Youn
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-10-03 00:00:00.000000000 Z
11
+ date: 2015-10-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -70,6 +70,8 @@ files:
70
70
  - bin/console
71
71
  - bin/setup
72
72
  - lib/unit_conversion.rb
73
+ - lib/unit_conversion/distance_conversion.rb
74
+ - lib/unit_conversion/temperature_conversion.rb
73
75
  - lib/unit_conversion/version.rb
74
76
  - unit_conversion.gemspec
75
77
  homepage: https://github.com/eternal44/unit_conversion