Last active
December 28, 2015 16:38
-
-
Save joseluistorres/7529948 to your computer and use it in GitHub Desktop.
Solucion Ducktyping
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 BuenFin | |
| def revisa_oferta(objetos_a_validar) | |
| objetos_a_validar.each do |objeto| | |
| objeto.valida_este_objeto | |
| end | |
| end | |
| end | |
| class PantallaPlana | |
| def valida_este_objeto | |
| checar_cuanto_cuesta_y_a_cuantos_meses | |
| end | |
| def checar_cuanto_cuesta_y_a_cuantos_meses | |
| 1000 | |
| end | |
| end | |
| class Celular4taGeneracion | |
| def valida_este_objeto | |
| checar_si_tiene_garantia | |
| end | |
| def checar_si_tiene_garantia | |
| 'maybe' if 'telcel' | |
| end | |
| end | |
| class MueblesCaros | |
| def valida_este_objeto | |
| ver_cuanto_y_porque_tan_caro | |
| end | |
| def ver_cuanto_y_porque_tan_caro | |
| 'mucho-muy' | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment