imc_guilherme 0.1.0
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 +7 -0
- data/lib/imc_guilherme/pessoa.rb +40 -0
- data/lib/imc_guilherme/version.rb +5 -0
- data/lib/imc_guilherme.rb +10 -0
- metadata +47 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 5f96b1a32c366c6fe389e74bfbc73c0394d45d84f5f6eb1e0d240ce04d616c7a
|
4
|
+
data.tar.gz: 00f33c80ae1420af6017bcf07073d978f772ca65c624cc4a8dc279c645069974
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 501adb5ec54fc0ed2f980ec9d77eb1e53de0fb5c4d721bee7aeb17ce0d1e6ca1d9aa2ff05237655e2ae4266a742a4333157de10ea1a64a63ae24e9657ccb46cf
|
7
|
+
data.tar.gz: 2dbe28da11458666fc77376678dfa55cb08937a64fc8f42c9f554428b209a98caad4ae53560dc01b6c1689888e2815eaefa59245d1bce9d1b249b1c1977f8aac
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module ImcGuilherme
|
4
|
+
class Pessoa
|
5
|
+
#Metodo que solicita o peso e a altura do usuário
|
6
|
+
def peso_altura
|
7
|
+
print "Informe seu Peso: "
|
8
|
+
@peso = gets.to_f
|
9
|
+
print "Informe sua Altura: "
|
10
|
+
@altura = gets.to_f
|
11
|
+
""
|
12
|
+
end
|
13
|
+
|
14
|
+
#Metodo que calcula o IMC e retorna a classificação de acordo com a OMS
|
15
|
+
def calculo_imc
|
16
|
+
imc = @peso / (@altura**2)
|
17
|
+
result = "Seu IMC é: #{imc.round(2)}\n"
|
18
|
+
|
19
|
+
case imc
|
20
|
+
when 0...18.5
|
21
|
+
result += "Baixo peso"
|
22
|
+
when 18.5...24.9
|
23
|
+
result += "Peso normal"
|
24
|
+
when 25...29.9
|
25
|
+
result += "Sobrepeso"
|
26
|
+
when 30...34.9
|
27
|
+
result += "Obesidade Grau 1"
|
28
|
+
when 35...39.9
|
29
|
+
result += "Obesidade Grau 2"
|
30
|
+
else
|
31
|
+
result += "Obesidade Grau 3"
|
32
|
+
end
|
33
|
+
|
34
|
+
result
|
35
|
+
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
metadata
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: imc_guilherme
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Carlos Guilherme
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2024-05-20 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: Gem para calcular o índice de massa corporal e classificá-lo conforme
|
14
|
+
a Organização Mundial da Saúde.
|
15
|
+
email:
|
16
|
+
- guilhermeagripino@gmail.com
|
17
|
+
executables: []
|
18
|
+
extensions: []
|
19
|
+
extra_rdoc_files: []
|
20
|
+
files:
|
21
|
+
- lib/imc_guilherme.rb
|
22
|
+
- lib/imc_guilherme/pessoa.rb
|
23
|
+
- lib/imc_guilherme/version.rb
|
24
|
+
homepage: https://github.com/Guilherme-Dev-Java/imc_guilherme
|
25
|
+
licenses:
|
26
|
+
- MIT
|
27
|
+
metadata: {}
|
28
|
+
post_install_message:
|
29
|
+
rdoc_options: []
|
30
|
+
require_paths:
|
31
|
+
- lib
|
32
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
33
|
+
requirements:
|
34
|
+
- - ">="
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: 3.0.0
|
37
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - ">="
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '0'
|
42
|
+
requirements: []
|
43
|
+
rubygems_version: 3.4.19
|
44
|
+
signing_key:
|
45
|
+
specification_version: 4
|
46
|
+
summary: Gem para calcular o IMC
|
47
|
+
test_files: []
|