Last active
January 4, 2016 08:59
-
-
Save joseluistorres/8599181 to your computer and use it in GitHub Desktop.
Herencia - Parte 3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Taco | |
| … | |
| def verdura | |
| if @sabor=='pastor | |
| { cebolla: cebolla, | |
| :cilantro cilantro} | |
| elsif @sabor=='tripita | |
| {cebolla: cebolla, | |
| :cilantro cilantro, | |
| :pina pina} | |
| end | |
| end | |
| end | |
| class Taco attr_reader :maiz_o_harina, :cebolla, :cilantro | |
| def initialize(args) | |
| @maiz_o_harina = args[:maiz_o_harina] | |
| @cebolla = args[:cebolla] || con_cebolla | |
| @cilantro = args[:cilantro] || con_cilantro | |
| end | |
| def verdura | |
| { cebolla: cebolla, | |
| :cilantro cilantro} | |
| end | |
| def con_cebolla | |
| 'si' | |
| end | |
| def con_cilantro | |
| 'si' | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment