Created
March 16, 2013 09:11
-
-
Save bnagy/5175611 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Player | |
def initialize(name, health=100) | |
@name = name.capitalize | |
@health = health | |
end | |
def say_hello | |
puts "I'm #{@name} with a health of #{@health}." | |
end | |
def blam | |
apply_damage 10 | |
end | |
def woot | |
apply_damage 25 | |
end | |
def apply_damage amount | |
# write this | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment