From b8fde967acb22e54303af4405d5cc653b7259474 Mon Sep 17 00:00:00 2001 From: 501547952 Date: Sun, 6 Mar 2016 12:31:31 -0500 Subject: [PATCH] sarika's retail jam --- admin.rb | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/admin.rb b/admin.rb index 06551b9..741327b 100644 --- a/admin.rb +++ b/admin.rb @@ -1,7 +1,33 @@ require 'pry' -#you run a site that offers a matching service between vendors selling laptops and customers -#..looking to purchase; you charge a fee to be listed as a vendor +def user_permission (signed_in, admin, paid, cancelled) + if (paid=="no") or (cancelled=="yes") + puts "go away!" + elsif (signed_in=="yes") and (admin=="yes") + puts "you can see and change all the pages!" + elsif (signed_in=="yes") and (admin=="no") + puts "you can see all the pages!" +elsif (signed_in=="no") +puts "you can't see any of the pages, please sign in!" +end +end + + puts "have you paid your bills? answer yes or no" + user_paid = gets.strip + + puts "have you cancelled a deal? answer yes or no" + user_deal = gets.strip + + puts "are you an admin? answer yes or no" + user_admin = gets.strip + + puts "are you signed in? answer yes or no" + user_signed = gets.strip + + user_permission(user_signed, user_admin, user_paid, user_deal) + +#you run a site that offers a matching service between vendors selling laptops and customers +#..looking to purchase; you charge a fee to be listed as a vendor #your site's users must sign in and if they are an admin they are able to make changes to the site ####################################################### @@ -28,4 +54,4 @@ #store their answer in a variable -#call the function +#call the function