Class: Plato
- Inherits:
-
Object
- Object
- Plato
- 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
-
#descripcion ⇒ Object
readonly
Returns the value of attribute descripcion.
-
#ingesta ⇒ Object
readonly
Returns the value of attribute ingesta.
-
#porcion ⇒ Object
readonly
Returns the value of attribute porcion.
Instance Method Summary collapse
-
#initialize(plato) ⇒ Plato
constructor
A new instance of Plato.
- #to_s ⇒ Object
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
#descripcion ⇒ Object (readonly)
Returns the value of attribute descripcion.
13 14 15 |
# File 'lib/menu/plato.rb', line 13 def descripcion @descripcion end |
#ingesta ⇒ Object (readonly)
Returns the value of attribute ingesta.
13 14 15 |
# File 'lib/menu/plato.rb', line 13 def ingesta @ingesta end |
#porcion ⇒ Object (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_s ⇒ Object
22 23 24 25 |
# File 'lib/menu/plato.rb', line 22 def to_s s="#{@descripcion}, #{@porcion}, #{@ingesta}" s end |