diff --git a/hero.rb b/hero.rb new file mode 100644 index 0000000..be97c4d --- /dev/null +++ b/hero.rb @@ -0,0 +1,28 @@ +class Hero + def initialize(name, health=100) + @name = name.capitalize + @health = health + end + + def name + @name + end + + def power_up + @health += 10 + end + + def power_down + @health -= 10 + end + + def hero_info + "#{@name}\'s health is #{@health}" + end +end + +hero = Hero.new 'mike' +puts hero.name +puts hero.power_up +puts hero.power_down +puts hero.hero_info \ No newline at end of file