basic inheritance in ruby
class Pokemon
def initialize(name, attack, defence)
@name = name
@attack = attack
@defence = defence
end
def damage(amount)
@defence -= amount
end
def raiseatk(amount)
@attack += amount
end
end
class Charmander < Pokemon
def flamethrow(oppoent)
opponent.damage(3)
end
end