class Random_Imdb

Public Class Methods

new() click to toggle source
# File lib/random_imdb.rb, line 5
def initialize

        greeting

        lines

        link?

        lines_2

        @scraper = Scraper.new

        lines

        how_many_pages

        lines_2

        @scraper.ask_for_pages

        take_a_moment

        @scraper.page_to_movies_hash

        your_random_movie

        section

        @scraper.choose_random

        section

        list?

        @scraper.get_description

        last_question
end

Public Instance Methods

last_question() click to toggle source
# File lib/random_imdb.rb, line 65
def last_question
        end_question

        input = gets.downcase.chomp.strip

        if input["y"]
        enjoy
        elsif input["n"]
        another?
        new_input = gets.downcase.chomp.strip
        if new_input["y"]
                restart
        elsif new_input["n"]
                goodbye
        end
else
        last_question
        end
end
restart() click to toggle source
# File lib/random_imdb.rb, line 44
def restart
        
        take_a_moment

        @scraper.page_to_movies_hash

        your_random_movie

        section

        @scraper.choose_random

        section

        list?

        @scraper.get_description

        last_question
end