Skip to content

Instantly share code, notes, and snippets.

@kkchu791
Last active November 14, 2015 23:56
Show Gist options
  • Save kkchu791/93c89f43c120839e84bd to your computer and use it in GitHub Desktop.
Save kkchu791/93c89f43c120839e84bd to your computer and use it in GitHub Desktop.
class Person
attr_reader :balance
def balance(balance)
@balance = balance
end
def balance_test?
p "Your balance measurement is: #{@balance}"
if @balance > 500
"You could be a gymnast"
elsif @balance > 100 && @balance < 500
"You have normal balance"
else
"You either have terrible balance or drank too much"
end
end
end
gymnast = Person.new
gymnast.balance(600)
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