Skip to content

Instantly share code, notes, and snippets.

@pbalduino
Created February 12, 2014 18:23
Show Gist options
  • Select an option

  • Save pbalduino/8961527 to your computer and use it in GitHub Desktop.

Select an option

Save pbalduino/8961527 to your computer and use it in GitHub Desktop.
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