Skip to content

Instantly share code, notes, and snippets.

@shinobcrc
Forked from davidvandusen/renter.rb
Last active June 21, 2016 21:36
Show Gist options
  • Save shinobcrc/0e562bdd736f1d9e7f8a0b81121172c8 to your computer and use it in GitHub Desktop.
Save shinobcrc/0e562bdd736f1d9e7f8a0b81121172c8 to your computer and use it in GitHub Desktop.
# must be baller and either furnished or rent cheaper than 2100
def rent?(furnished, rent, baller)
if baller && furnished || rent < 2100
return true
else
return false
end
end
###
# Add your "test" ("driver") code below in order to "test drive" (run) your method above...
# The test code will call the method with different permutations of options and output the result each time.
# This way, you will be able to run the renter.rb file from the CLI and look at the output of your "tests" to validate if the method works.
# Without the test code, it will be hard for you to know if this method is working as it should or not.
###
###
#Testing
# puts(rent?(true,2000,true))
# puts(rent?(true,2000,false))
# puts(rent?(false,1900,true))
# puts(rent?(true,200000,false))
#Altered rent
def new_rent?(furnished, rent, baller)
if baller && (furnished || rent <2100)
return true
else
return false
end
end
puts(new_rent?(false,2000,true))
puts(new_rent?(true,2000000,true))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment