Created
November 18, 2013 15:16
-
-
Save joseluistorres/7529435 to your computer and use it in GitHub Desktop.
Ejemplo para Duck Typing
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| | |
| case objeto | |
| when PantallaPlana | |
| objeto.checar_cuanto_cuesta_y_a_cuantos_meses | |
| when Celular4taGeneracion | |
| objeto.checar_si_tiene_garantia | |
| when MueblesCaros | |
| objeto.ver_cuanto_y_porque_tan_caro | |
| end | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment