Skip to content

Instantly share code, notes, and snippets.

@slant
Created September 8, 2008 23:18
Show Gist options
  • Save slant/9568 to your computer and use it in GitHub Desktop.
Save slant/9568 to your computer and use it in GitHub Desktop.
def kill_them(c_id)
puts
puts "---------------------------------------------"
if (c = Customer.find_by_id(c_id))
puts " " + c.name
puts "---------------------------------------------"
print " Delete this customer? (y/n): "
answer = gets.chomp
if answer == "y"
kill_customer(c)
puts Customer.find_by_id(c_id) ? " There was a problem deleting this customer." : " Customer successfully deleted."
elsif answer == "n"
puts " Alright. " + c.first_name + " is safe... for now."
else
puts " '" + answer.to_s + "' is not a valid entry."
end
else
puts " Customer not found"
end
puts "---------------------------------------------"
puts
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment