Module: Printer
- Defined in:
- lib/Printer.rb
Instance Method Summary collapse
- #get_choice_from_above ⇒ Object
- #get_provider_name ⇒ Object
- #list_right_options ⇒ Object
- #menu_screen ⇒ Object
- #print_from_arr_of_o(instances_of_objects) ⇒ Object
- #print_from_arr_of_s(array_to_print) ⇒ Object
- #print_this(for_printing) ⇒ Object
- #print_whole_profile(provider_instance) ⇒ Object
- #warning_message ⇒ Object
- #warning_message_team ⇒ Object
Instance Method Details
#get_choice_from_above ⇒ Object
99 100 101 102 |
# File 'lib/Printer.rb', line 99 def get_choice_from_above puts "Please choose from the list above to get the relevant providers:" user_input = gets.strip end |
#get_provider_name ⇒ Object
92 93 94 95 |
# File 'lib/Printer.rb', line 92 def get_provider_name puts "Which provider?" user_input = gets.strip end |
#list_right_options ⇒ Object
42 43 44 45 46 |
# File 'lib/Printer.rb', line 42 def puts "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" puts "!!!!!!!!!!!!! Please enter either 1, 2, 3 or 4 !!!!!!!!!!!!" puts "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" end |
#menu_screen ⇒ Object
50 51 52 53 54 55 56 57 58 |
# File 'lib/Printer.rb', line 50 def puts "Choose from the following menu:" puts "1) List of all providers" puts "2) Details on a specific provider" puts "3) List of providers by their team" puts "4) List of providers by their specialty" puts "5) List of providers by their languages" puts "6) Get a specific provider's team?" end |
#print_from_arr_of_o(instances_of_objects) ⇒ Object
62 63 64 65 66 67 68 69 |
# File 'lib/Printer.rb', line 62 def print_from_arr_of_o(instances_of_objects) puts "<<<<<<<<<<<< HERE IS THE LIST: >>>>>>>>>>>" instances_of_objects.each do |object| puts object.name end puts "^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^" puts "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^" end |
#print_from_arr_of_s(array_to_print) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/Printer.rb', line 23 def print_from_arr_of_s(array_to_print) if array_to_print.length == 0 else puts "<<<<<<<<<<<< HERE IS THE LIST: >>>>>>>>>>>" i = 0 while i < array_to_print.size puts array_to_print[i] i+=1 end puts "^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^" puts "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^" end end |
#print_this(for_printing) ⇒ Object
106 107 108 109 110 |
# File 'lib/Printer.rb', line 106 def print_this(for_printing) puts "*****************************************************" puts " #{for_printing} " puts "*****************************************************" end |
#print_whole_profile(provider_instance) ⇒ Object
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/Printer.rb', line 73 def print_whole_profile(provider_instance) puts "==============================" if Teams.team_by_provider_name(provider_instance.name) != nil puts "#{provider_instance.name}'s team: #{Teams.team_by_provider_name(provider_instance.name)}" end puts "#{provider_instance.name}'s specialties: #{Specialites.specialties_by_provider(provider_instance)}" #puts "#{provider_instance.name}'s specialties: #{provider_instance.specialties}" puts "#{provider_instance.name}'s languages: #{Languages.languages_by_provider(provider_instance)}" puts "#{provider_instance.name}'s qualifications: #{provider_instance.qualifications}" if provider_instance.title != nil puts "#{provider_instance.name}'s title: #{provider_instance.title}" end puts "==============================" end |
#warning_message ⇒ Object
7 8 9 10 11 |
# File 'lib/Printer.rb', line 7 def puts "======================================================================================================" puts "!!!!!!!! The doctor, team or specialty that you have choosen does not exit in this clinic !!!!!!!!" puts "======================================================================================================" end |
#warning_message_team ⇒ Object
15 16 17 18 19 |
# File 'lib/Printer.rb', line 15 def puts "======================================================================================================" puts "!!!!!!!! You've chosen a doctor that either does not exist or is not part os any team !!!!!!!!" puts "======================================================================================================" end |