#! /usr/bin/env ruby
classHumandefinitialize(name)@name= name
enddefspecial
puts "#{@name} is normal, no special abilities."endalias_method:abilities,:specialendclassHero< Humanattr_accessor:powersdefspecialunless@powerssuperelse
puts "#{@name} is a hero - he/she can #{@powers}"endendalias_method:abilities,:specialendclassBadGuy< Humanattr_accessor:powersdefspecialunless@powerssuperelse
puts "#{@name} is a hero - he/she can #{@powers}"endendalias_method:abilities,:specialend
mohinder =Human.new('Mohinder')
mohinder.special # Mohinder is normal, no special abilities.
mohinder.abilities # Mohinder is normal, no special abilities.
peter =Hero.new('Peter Petrelli')
peter.powers ="mimic the powers of other heroes nearby, fly, and read minds"
peter.special # Peter Petrelli is a hero - he/she can mimic the powers of other heroes nearby, fly, and read minds
peter.abilities # Peter Petrelli is a hero - he/she can mimic the powers of other heroes nearby, fly, and read minds
sylar =BadGuy.new('Sylar')
sylar.powers ="steal powers from other heroes, telekinetics, and super-hearing"
sylar.special # Sylar is a hero - he/she can steal powers from other heroes, telekinetics, and super-hearing
sylar.abilities # Sylar is a hero - he/she can steal powers from other heroes, telekinetics, and super-hearing
hrg =Hero.new('Horn-Rimmed Glasses')
hrg.special # Horn-Rimmed Glasses is normal, no special abilities.
hrg.abilities # Horn-Rimmed Glasses is normal, no special abilities.