Created
February 15, 2011 01:14
-
-
Save xenda/826919 to your computer and use it in GitHub Desktop.
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 Refrigeradora | |
| def initialize | |
| @comida = [] | |
| end | |
| def comida | |
| @comida | |
| end | |
| def +(objeto) | |
| @comida << objeto | |
| end | |
| end | |
| class Leche | |
| end | |
| class Queso | |
| end | |
| class Agua | |
| end | |
| refri = Refrigeradora.new | |
| leche = Leche.new | |
| queso = Queso.new | |
| agua = Agua.new | |
| refri +leche | |
| refri + queso | |
| refri + agua | |
| puts refri.comida | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment