class TellyReviews::CLI

Public Instance Methods

call() click to toggle source
# File lib/telly_reviews/cli.rb, line 3
def call
  puts ""
  puts "Welcome to Telly Reviews"
  puts "---------------------------------"
  TellyReviews::Scraper.make_list
  start
end
print_details(review) click to toggle source
print_list() click to toggle source
print_review(review) click to toggle source
start() click to toggle source
# File lib/telly_reviews/cli.rb, line 11
def start 
  puts ""
  print_list
  puts "---------------------------------"
  puts ""
  puts "Enter number to see article:"
  input = gets.strip

  review = TellyReviews::Review.find(input.to_i)
  print_review(review)
  puts ""
  puts "Type 'open' to open this article in your web browser."
  puts "Would you like to read another review? (y/n)"
  input = gets.strip.downcase
  if input == 'y'
    puts ""
    start
  elsif input == 'open'
    system("open", "#{review.url}")
    start
  else
    puts "Please come back soon for more updated reviews!"
    exit
  end
end