imc_alves 0.1.0 → 0.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c7b1c428c02983952f160b3cb9c710a06d093ac97d1af7dcbcc212951745be67
4
- data.tar.gz: d29e1c08fbcea131a69cc5a4fd1cc4879e7d1fcfe26f847c4061619f3973b0f4
3
+ metadata.gz: 5e0eb413cad23a4b02e2c28d8712a0b1d3f06975fe8a874ab86fe7e8a81d5765
4
+ data.tar.gz: c1c9a44b65dfb2018d70861ee6fb1a82ab8464f1981b4258c129cd546363655d
5
5
  SHA512:
6
- metadata.gz: f72fc13ab8695ca6848cdd84d3dbd455cc6a8e14e3b7dd16797b8051a1a3aead6964bfcb093da46463273fdf09374709226e0fa17d92478b14a72857bc8a1afd
7
- data.tar.gz: 2c418cc728cc893ac9f83f045894c5f631335e64b318de6e8b2c2928f1610a20fce9f681ba4da66c4f941ce4028371dff79044df746bff1d81467bf3c6b6fc00
6
+ metadata.gz: 10180531185699c8d682186e227e2f4cc9a09943ddfaed5192095e28563abeb39ac3460fdc1543b1d1c1e5c7b364e3566b69e23c597bed44f267b498b49371c4
7
+ data.tar.gz: f4d1a81db29d7168d734ae33edd5eb96a6dcf765226b8f68dee91aefcf823bd7a4944b12dc6436039aeb44ebd926746063af6cacc0a014fb5289245d6ba1b4ac
data/README.md CHANGED
@@ -3,18 +3,20 @@
3
3
  Gem desenvolvida para calcular o imc e mostrar o Estado Nutricional da pessoa.
4
4
 
5
5
  ## Installation
6
- $ gem install imc_alves
6
+ gem install imc_alves
7
7
 
8
8
  ## Usage
9
9
 
10
10
  obj = ImcAlves::Pessoa.new(peso, altura)
11
11
 
12
- print obj.calc_imc
12
+ print obj.imc
13
+ print obj.estado_nutricional
14
+
13
15
  print obj.status
14
16
 
15
17
  ## Contributing
16
18
 
17
- email@example.com
19
+ email@example.com
18
20
 
19
21
  ## License
20
22
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ImcAlves
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.2"
5
5
  end
data/lib/imc_alves.rb CHANGED
@@ -14,7 +14,6 @@ module ImcAlves
14
14
  @peso = peso
15
15
  @altura = altura
16
16
  @imc = calc_imc
17
- @en_index = 0
18
17
 
19
18
  @est_nut = {
20
19
  'Desnutrição Grau V': [10, "< 10"],
@@ -32,10 +31,6 @@ module ImcAlves
32
31
  @estado_nutricional = est_nutri
33
32
  end
34
33
 
35
- def calc_imc
36
- (@peso / @altura**2).round(2)
37
- end
38
-
39
34
  def status
40
35
  puts "IMC: #{@imc}"
41
36
  puts "Estado Nutricional: #{@estado_nutricional}"
@@ -50,6 +45,10 @@ module ImcAlves
50
45
 
51
46
  private
52
47
 
48
+ def calc_imc
49
+ (@peso / @altura**2).round(2)
50
+ end
51
+
53
52
  def est_nutri
54
53
  @est_nut.each do |k, v|
55
54
  return k if @imc < v[0]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: imc_alves
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - guinn83
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-03-07 00:00:00.000000000 Z
11
+ date: 2023-03-08 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Calcular o IMC e mostrar o Estado Nutricional da pessoa
14
14
  email: