Created
November 16, 2015 19:26
-
-
Save kkchu791/7e618cd70b23e54e9a20 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 Person | |
attr_accessor :balance | |
Inf = 1.0/0.0 | |
def balance_test | |
puts "Your balance measurement is: #@balance" | |
case balance | |
when 500...Inf | |
"You could be a gymnast" | |
when 100...500 | |
"You have normal balance" | |
else | |
"You either have terrible balance or drank too much" | |
end | |
end | |
end | |
gymnast = Person.new | |
gymnast.balance = 100000000 | |
p gymnast.balance_test | |
drunkard = Person.new | |
drunkard.balance = 50 | |
p drunkard.balance_test |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment