Skip to content

Instantly share code, notes, and snippets.

@bnagy
Created March 16, 2013 09:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bnagy/5175611 to your computer and use it in GitHub Desktop.
Save bnagy/5175611 to your computer and use it in GitHub Desktop.
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