From 3109dd2551c1523d45d3b068b3c0d5c9855b327e Mon Sep 17 00:00:00 2001 From: Jay Date: Sun, 6 Dec 2015 14:36:27 -0500 Subject: [PATCH 1/2] changes to the admin exercise --- admin.rb | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/admin.rb b/admin.rb index aacb9a3..dd3ae78 100644 --- a/admin.rb +++ b/admin.rb @@ -1,32 +1,30 @@ 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 +#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 -#______________________________________________ +######################################################## #write a function "user_permission" that accepts four parameters: signed_in, admin, paid, and canceled -#if the user doesn't pay their bills or has canceled a deal, show "go away!" -#if the user is signed in and they are an admin, show "you can see see and change all the pages!" -#if you user is signed in but they are not an admin, show "you can see all the pages!" -#if the user is not signed in, show "you can't see any of the pages, please sign in!" #ask the user if they pay their bills (yes/no) - #store their answer in a variable #ask the user if they have canceled a deal (yes/no) - #store their answer in a variable #ask the user if they are an admin (yes/no) - #store their answer in a variable #ask the user if they are signed in (yes/no) - #store their answer in a variable +#if the user doesn't pay their bills or has canceled a deal, show "go away!" +#if the user is signed in and they are an admin, show "you can see see and change all the pages!" +#if you user is signed in but they are not an admin, show "you can see all the pages!" +#if the user is not signed in, show "you can't see any of the pages, please sign in!" + +# call the function From 7722f78c4f604a0966d1980b490ae60797a924cc Mon Sep 17 00:00:00 2001 From: Adriana Date: Sun, 6 Dec 2015 15:24:38 -0500 Subject: [PATCH 2/2] version 2 --- admin.rb | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/admin.rb b/admin.rb index dd3ae78..d63b790 100644 --- a/admin.rb +++ b/admin.rb @@ -1,4 +1,4 @@ -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 @@ -7,11 +7,40 @@ ######################################################## #write a function "user_permission" that accepts four parameters: signed_in, admin, paid, and canceled - +def user_permission + puts "please sign in" + sign in = gets.strip + if sign in = "signed_in" + puts "" + + end + + end + + end +end #ask the user if they pay their bills (yes/no) #store their answer in a variable +def pay_bills + puts "Do you pay your bils?" + pay_bills = gets.strip + if pay_bills = "no" + puts "go away!" + if pay_bills = "yes" + puts "you can see all the pages" + + end + + +end #ask the user if they have canceled a deal (yes/no) +def canceled_deal + if canceled_deal = "yes" + puts "go away!" + end + +end #store their answer in a variable #ask the user if they are an admin (yes/no)