class Individuo

including mixin Comparable

Attributes

apellidos[RW]
cadera[RW]
cintura[RW]
edad[RW]
efecto_t_a[RW]
factor_actvf[RW]
gasto_e_basal[RW]
gasto_e_total[RW]
gasto_ef[RW]
genero[RW]
imc[RW]
nombre[RW]
peso[RW]
peso_t_i[RW]
porcentgrasa[RW]
rcc[RW]
talla[RW]

Public Class Methods

new(nombre, apellidos, edad, genero, peso, talla, cadera, cintura, imc, porcentgrasa, rcc, peso_t_i, gasto_e_basal, efecto_t_a, gasto_ef, factor_actvf, gasto_e_total) click to toggle source

Method to initialize every anthropometric measures

# File lib/menud/menud.rb, line 29
def initialize(nombre, apellidos, edad, genero, peso, talla, cadera, cintura, imc, porcentgrasa, rcc, peso_t_i, gasto_e_basal, efecto_t_a, gasto_ef, factor_actvf, gasto_e_total)

        
       
        
                    
                @nombre = nombre
                @apellidos = apellidos
                @edad = edad
                @genero = genero
                @peso = peso
                @talla = talla
                @cadera = cadera
                @cintura = cintura
                @imc = imc
                @porcentgrasa = porcentgrasa
                @rcc = rcc
                @peso_t_i = peso_t_i
                @gasto_e_basal = gasto_e_basal
                @efecto_t_a = efecto_t_a
                @gasto_ef = gasto_ef
                @factor_actvf = factor_actvf
                @gasto_e_total = gasto_e_total
                
                    
                    
end

Public Instance Methods

<=>(other) click to toggle source
# Method to transform into string
def to_s

        "#{@nombre}\n"
        "#{@apellidos}\n"

end

# Method to get the value of imc and do the comparison

# File lib/menud/menud.rb, line 66
def <=> (other)
    
    
   @imc <=> other.imc
    
end
efecto_termogeno_alimentos() click to toggle source
# File lib/menud/menud.rb, line 130
def efecto_termogeno_alimentos
    
  @efecto_t_a = (@gasto_e_basal * 0.10)  
    
end
gasto_actividadf() click to toggle source
# File lib/menud/menud.rb, line 137
def gasto_actividadf
    
 @gasto_ef = (@gasto_e_basal * @factor_actvf).round(2)
    
end
gasto_energetico_basal() click to toggle source
# File lib/menud/menud.rb, line 117
def gasto_energetico_basal
        
    if (@sexo = 1)
            
        @gasto_e_basal = ((10 * @peso) + (6.25 * @talla) - (5 * @edad) + 5 ) 
    
    elsif
         @gasto_e_basal = ((10 * @peso) + (6.25 * @talla) - (5 * @edad) - 161 ) 
    end
        
    
end
gasto_energetico_t() click to toggle source
# File lib/menud/menud.rb, line 144
def gasto_energetico_t
    
 @gasto_e_total = (@gasto_e_basal + @efecto_t_a + @gasto_ef)  
    
end
peso_total_ideal() click to toggle source

# Method to transform into int def to_i

"#{@edad}"
"#{@genero}"
"#{@peso}"

end

# Method to transform into float def to_f

"#{@talla}"
"#{@cadera}"
"#{@cintura}"
"#{@imc}"
"#{@porcentgrasa}"
"#{@rcc}"
"#{@peso_t_i}"
"#{@gasto_e_basal}"
"#{@efecto_t_a}"
"#{@gasto_ef}"
"#{@factor_actvf}"
"#{@gasto_e_total}"

end

# File lib/menud/menud.rb, line 110
def peso_total_ideal
    
@peso_t_i = ((@talla - 150) * 0.75 + 50)
    
    
end