Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Troll
- attr_accessor :nome, :hp, :cor
- def initialize(nome, hp, cor)
- @nome = nome
- @hp = hp
- @cor = cor
- end
- def gritar(grito)
- puts "Meu nome é #{self.nome}"
- puts "#{grito}"
- end
- end
- blinky = Troll.new("Blinky", 100, "Azul")
- blinky.gritar("Argh arg Arghu")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement