module Fourteeninch class Core def self.press_a_key print "Please press any key to continue..." begin system("stty raw -echo") STDIN.getc ensure system("stty -raw echo") end end def self.clear system("clear") || system("cls") end def self.core Fourteeninch.load_settings if Fourteeninch::Auth.auth != false menu = Fourteeninch::Core.do_core(0) while menu != -1 menu = Fourteeninch::Core.do_core(menu) end else puts "You are not logged in. Run `fourteeninch login` now to access fourteeninch core." end end def self.do_core(menu = 0) clear case menu when 0 return Fourteeninch::MainMenu.intro when 1 return Fourteeninch::Customers.customers_menu when 11 return Fourteeninch::Customers.list_customers when 12 return Fourteeninch::Customers.new_customer when 2 # Show invoices menu when 3 #show Admin Users Menu when 9 Fourteeninch::Auth.logout puts "Good bye..." return -1 when 0 puts "Good bye..." return -1 else return 0 end end end end