class Top25::Cli

Public Instance Methods

display_places() click to toggle source
# File lib/top25/cli.rb, line 51
def display_places
  Top25::Place.all.each do |pl|
    puts "#{pl.num}. #{pl.name}-based in: #{pl.location}"
    puts "Website: #{pl.url}"
    puts "-------------------------------------".colorize(:green)
    end
end
home() click to toggle source
# File lib/top25/cli.rb, line 3
def home
    puts "Search for the best in the world, choose one of the follwing numbers"
    puts "1. Hotels\n2. Restaurants\n3. Beaches\n4. for exit"
    take_input
end
make_places(name) click to toggle source
# File lib/top25/cli.rb, line 45
def make_places(name)
  scraper = Top25::Scraper.new
  arrofplaces = scraper.scrap_index_page(name)
  Top25::Place.create_from_collection(arrofplaces)
end
run(place) click to toggle source
# File lib/top25/cli.rb, line 39
def run(place)
  make_places(place)
  #add_attributes
  display_places
end
take_input() click to toggle source
# File lib/top25/cli.rb, line 9
def take_input
  input =""
  input = gets.strip
  search(input)
end