linh 0.0.0 → 0.0.2
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/linh.rb +6 -16
- data/lib/linh/result.rb +22 -0
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8c2cc689282fabcf6dd6e79e6540fc4e37104633
|
4
|
+
data.tar.gz: 1ad041085f666df7d6cdf3a507684eb364558c49
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b7c0e6ce2b8fd3fbccc0390338ea6a1160c6e831352e91cab16c63de2e96b7608b4f4edf87ad3ae02487001afdd4571d668c910d7cb3ecbd89b64b1f45471ca4
|
7
|
+
data.tar.gz: 96c69653c1fd560d83419c0f7e6fc29ab370f80890310ccdecdc59730e18b322fc8357e5efed3db2585f7928ab2472115a2b4f98587e134e45a0932d0dc17cf2
|
data/lib/linh.rb
CHANGED
@@ -8,21 +8,11 @@ class Linh
|
|
8
8
|
w = gets.chomp.to_f
|
9
9
|
|
10
10
|
bmi = w/((h/100)**2)
|
11
|
-
|
11
|
+
puts "BMI = #{bmi}"
|
12
12
|
|
13
|
-
|
14
|
-
|
15
|
-
puts "Very severely underweight"
|
16
|
-
when 15 .. 16
|
17
|
-
puts "Severely underweight"
|
18
|
-
when 16 .. 18.5
|
19
|
-
puts "Underweight"
|
20
|
-
when 18.5 .. 25
|
21
|
-
puts "Normal"
|
22
|
-
when 25 .. 30
|
23
|
-
puts "Overweight"
|
24
|
-
else
|
25
|
-
puts "Obese Class"
|
26
|
-
end
|
13
|
+
result = Result.new(bmi)
|
14
|
+
result.put
|
27
15
|
end
|
28
|
-
end
|
16
|
+
end
|
17
|
+
|
18
|
+
require 'linh/result'
|
data/lib/linh/result.rb
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
class Result
|
2
|
+
def initialize(bmi)
|
3
|
+
@bmi = bmi
|
4
|
+
end
|
5
|
+
|
6
|
+
def put
|
7
|
+
case @bmi
|
8
|
+
when 0 .. 15
|
9
|
+
puts "Very severely underweight"
|
10
|
+
when 15 .. 16
|
11
|
+
puts "Severely underweight"
|
12
|
+
when 16 .. 18.5
|
13
|
+
puts "Underweight"
|
14
|
+
when 18.5 .. 25
|
15
|
+
puts "Normal"
|
16
|
+
when 25 .. 30
|
17
|
+
puts "Overweight"
|
18
|
+
else
|
19
|
+
puts "Obese Class"
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: linh
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bao Linh
|
@@ -10,16 +10,16 @@ bindir: bin
|
|
10
10
|
cert_chain: []
|
11
11
|
date: 2014-10-30 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
|
-
description:
|
13
|
+
description: BMI Calculating
|
14
14
|
email: a1447ll@aiit.ac.jp
|
15
15
|
executables: []
|
16
16
|
extensions: []
|
17
17
|
extra_rdoc_files: []
|
18
18
|
files:
|
19
19
|
- lib/linh.rb
|
20
|
+
- lib/linh/result.rb
|
20
21
|
homepage: http://rubygems.org/gems/linh
|
21
|
-
licenses:
|
22
|
-
- MIT
|
22
|
+
licenses: []
|
23
23
|
metadata: {}
|
24
24
|
post_install_message:
|
25
25
|
rdoc_options: []
|
@@ -37,7 +37,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
37
37
|
version: '0'
|
38
38
|
requirements: []
|
39
39
|
rubyforge_project:
|
40
|
-
rubygems_version: 2.
|
40
|
+
rubygems_version: 2.2.2
|
41
41
|
signing_key:
|
42
42
|
specification_version: 4
|
43
43
|
summary: My 1st gem
|