Created
February 12, 2014 18:23
-
-
Save pbalduino/8961527 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 Cachorro | |
| def nome(n) | |
| @nome = n | |
| end | |
| def self.especie(n) | |
| @@especie = n | |
| end | |
| def status | |
| puts @nome, @@especie | |
| end | |
| end | |
| rex = Cachorro.new | |
| rex.nome "Rex" | |
| Cachorro.especie "Cachorro" | |
| toto = Cachorro.new | |
| toto.nome "Totó" | |
| toto.status | |
| Cachorro.especie "Cão" | |
| rex.status | |
| toto.status |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment