class CLI

Public Class Methods

new(clinic_url = "http://callen-lorde.org/meet-our-providers/") click to toggle source
# File lib/CLI.rb, line 14
def initialize(clinic_url = "http://callen-lorde.org/meet-our-providers/")
  Scraper.scrape_page(clinic_url)
end

Public Instance Methods

start(clinic_url = "http://callen-lorde.org/meet-our-providers/") click to toggle source
# File lib/CLI.rb, line 20
def start(clinic_url = "http://callen-lorde.org/meet-our-providers/")

  Printer::menu_screen

  user_input = gets.strip.to_i

  valid?(user_input)

  if user_input == 1
    UserInputExe::choice_1
  elsif user_input == 2
    UserInputExe::choice_2
  elsif user_input == 3
    UserInputExe::choice_3
  elsif user_input == 4
    UserInputExe::choice_4
  elsif user_input == 5
    UserInputExe::choice_5
  else
    UserInputExe::choice_6
  end

  start

end
valid?(user_input) click to toggle source
# File lib/CLI.rb, line 48
def valid?(user_input)
  if user_input >= 1 && user_input <= 6
    true
  else
    Printer::list_right_options
    start
  end
end