class Randomeal::CLI

Attributes

selection[RW]

Public Instance Methods

call() click to toggle source
# File lib/randomeal/cli.rb, line 5
def call
    puts "Thank you for using Randomeal!  Your options are loading."
    options
    secondary_menu_options
    secondary_menu
end
menu() click to toggle source
options() click to toggle source
# File lib/randomeal/cli.rb, line 12
    def options
        puts <<-MENU

        "-*-*-*-*-*-*-*-*-*"

        What would you like to eat?

        1. Chicken
        2. Burgers
        3. Pasta
        4. Salad
        5. Dessert
        MENU
        menu
    end
secondary_menu() click to toggle source
# File lib/randomeal/cli.rb, line 61
def secondary_menu

    input = nil

    while input != "exit"
    input = gets.strip.downcase
        if input == "1"
            puts @selection.ingredients
        elsif input == "2"
            puts @selection.directions
        elsif input == "3"
            self.options
        else
            puts "Please make a valid selection or 'exit"
        end
        puts ""
        puts "-*-*-*-*-*-*-*-*-*"
        secondary_menu_options
        puts "-*-*-*-*-*-*-*-*-*"
    end
end
secondary_menu_options() click to toggle source
# File lib/randomeal/cli.rb, line 48
    def secondary_menu_options
        puts <<-SECONDARY
        
        Your meal is #{@selection.title}
        1. For ingredients
        2. For directions
        3. If you don't want to eat #{@selection.title}
        
        Type 'exit' to  quit.
        SECONDARY
    end