class CommandLineInterface

Constants

BASE_CATEGORIES
CATEGORY_BASE_URL

Public Instance Methods

call() click to toggle source
# File lib/recipe-grater/cli.rb, line 8
def call
    puts "Welcome to Grater! \n\n"
    puts "Select from the following categories: \n\n"
    print_categories
    print_collections(input)
    puts "\n\n"
    puts "Select a collections: \n\n"
    print_recipes(input)
    print_full_recipe(input)
end
create_recipe(chosen_recipe) click to toggle source
# File lib/recipe-grater/cli.rb, line 57
def create_recipe(chosen_recipe)
    recipe = Grater.all[chosen_recipe]
    details = Scraper.recipe_scraper(recipe.recipe_url)
    recipe.recipe_details_creator(details)
    recipe
end
create_recipe_list(input) click to toggle source
# File lib/recipe-grater/cli.rb, line 41
def create_recipe_list(input)
    collection = CategoryCreator.all[input]
    url = collection.category_url
    recipe_list = Scraper.recipe_index_page_scraper(url)
    Grater.recipe_creator(recipe_list)
end
input() click to toggle source
# File lib/recipe-grater/cli.rb, line 19
def input
    input = gets.chomp.to_i - 1
    input
end
print_categories() click to toggle source
print_collections(input) click to toggle source
print_full_recipe(chosen_recipe) click to toggle source
print_ingredients(chosen_recipe) click to toggle source
print_method(chosen_recipe) click to toggle source
print_recipes(input) click to toggle source