Class: Plato

Inherits:
Object
  • Object
show all
Defined in:
lib/menu/plato.rb

Overview

plato.rb

Autor

Jairo Gonzalez Lemus

Clase Persona

DefiniciĆ³n de la clase plato compuesta por

  • metodo initialize

  • metodo saludar

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(plato) ⇒ Plato

Returns a new instance of Plato.



15
16
17
18
19
# File 'lib/menu/plato.rb', line 15

def initialize(plato)
    @descripcion = "- #{plato[0]}"
    @porcion = plato[1]
    @ingesta = plato[2]
end

Instance Attribute Details

#descripcionObject (readonly)

Returns the value of attribute descripcion.



13
14
15
# File 'lib/menu/plato.rb', line 13

def descripcion
  @descripcion
end

#ingestaObject (readonly)

Returns the value of attribute ingesta.



13
14
15
# File 'lib/menu/plato.rb', line 13

def ingesta
  @ingesta
end

#porcionObject (readonly)

Returns the value of attribute porcion.



13
14
15
# File 'lib/menu/plato.rb', line 13

def porcion
  @porcion
end

Instance Method Details

#to_sObject



22
23
24
25
# File 'lib/menu/plato.rb', line 22

def to_s 
   s="#{@descripcion}, #{@porcion}, #{@ingesta}"
   s
end