Class: EtiquetaN

Inherits:
Object
  • Object
show all
Includes:
Comparable
Defined in:
lib/menud/menud.rb

Direct Known Subclasses

TProducto

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(netiqueta, venergeticokJ, venergeticokcal, cantgrasas, cantgrasasat, hidratosc, azucares, fibraa, proteinas, sales) ⇒ EtiquetaN

Initializing every characteristic about nutritional labels and his name



281
282
283
284
285
286
287
288
289
290
291
292
293
294
# File 'lib/menud/menud.rb', line 281

def initialize(netiqueta, venergeticokJ, venergeticokcal, cantgrasas, cantgrasasat, hidratosc, azucares, fibraa, proteinas, sales)

@netiqueta = netiqueta
@venergeticokJ = venergeticokJ
@venergeticokcal = venergeticokcal
@cantgrasas = cantgrasas
@cantgrasasat = cantgrasasat
@hidratosc = hidratosc
@azucares = azucares
@fibraa = fibraa
@proteinas = proteinas
@sales = sales

end

Instance Attribute Details

#azucaresObject

Returns the value of attribute azucares.



278
279
280
# File 'lib/menud/menud.rb', line 278

def azucares
  @azucares
end

#cantgrasasObject

Returns the value of attribute cantgrasas.



278
279
280
# File 'lib/menud/menud.rb', line 278

def cantgrasas
  @cantgrasas
end

#cantgrasasatObject

Returns the value of attribute cantgrasasat.



278
279
280
# File 'lib/menud/menud.rb', line 278

def cantgrasasat
  @cantgrasasat
end

#fibraaObject

Returns the value of attribute fibraa.



278
279
280
# File 'lib/menud/menud.rb', line 278

def fibraa
  @fibraa
end

#hidratoscObject

Returns the value of attribute hidratosc.



278
279
280
# File 'lib/menud/menud.rb', line 278

def hidratosc
  @hidratosc
end

#netiquetaObject

Returns the value of attribute netiqueta.



278
279
280
# File 'lib/menud/menud.rb', line 278

def netiqueta
  @netiqueta
end

#proteinasObject

Returns the value of attribute proteinas.



278
279
280
# File 'lib/menud/menud.rb', line 278

def proteinas
  @proteinas
end

#salesObject

Returns the value of attribute sales.



278
279
280
# File 'lib/menud/menud.rb', line 278

def sales
  @sales
end

#venergeticokcalObject

Returns the value of attribute venergeticokcal.



278
279
280
# File 'lib/menud/menud.rb', line 278

def venergeticokcal
  @venergeticokcal
end

#venergeticokJObject

Returns the value of attribute venergeticokJ.



278
279
280
# File 'lib/menud/menud.rb', line 278

def venergeticokJ
  @venergeticokJ
end

Instance Method Details

#<=>(other) ⇒ Object

Method to get the value of proteins and do the comparison



308
309
310
311
312
313
# File 'lib/menud/menud.rb', line 308

def <=> (other)
            
            
 @proteinas <=> other.proteinas
            
end