My first CLI program written in Ruby

  1. Welcome a user and explain what does this CLI do
  2. Ask for a user’s input for zip codes, decided if that is a valid input
  3. Search through yelp and get data
  4. Store data with Center object(Using data to make Center objects)
  5. Show the user a list of center names
  6. Ask the user which one they want to know more
  7. Quit or go back to step 2
if center.phone_number   
puts "Phone number: #{center.phone_number}"
end
if center.url
puts "Yelp page: #{center.url}"
end
def ending
puts "Do you want to re-enter a zip code? [Y/N]"
input=gets.strip
if input.upcase=="Y"
call
elsif input.upcase=="N"
else puts "Wrong input!"
puts "Give me only 'Y' or 'N' please."
ending #if no qualified input, then go for another "ending" loop
end
end

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store