lib/recipe_cli/cli.rb
#will prompt/gets recipe choice and will send to api. will call Recipe class object to add info
will prompt/gets recipe choice and will send to api. will call Recipe class object to add info
will prompt / gets recipe choice and will send to api . will call Recipe class object to add info
def user_recipe_choice
    puts "\nWhich recipe would you like to see?\nPlease input the recipe number:\n"
    input = gets.strip
    if valid_recipe_choice(input)
      recipe_index = (input.to_i - 1)
      attributes = EverythingButTheKitchenSink::SpoonacularApi.recipe_info(recipe_index)
      recipe_object = EverythingButTheKitchenSink::Recipe.all[recipe_index]
      EverythingButTheKitchenSink::TransformData.get_time_and_url(attributes, recipe_object)
      recipe_object
    else
      user_recipe_choice
    end
  end
def user_recipe_choice puts "\nWhich recipe would you like to see?\nPlease input the recipe number:\n" input = gets . strip if valid_recipe_choice ( input ) recipe_index = ( input . to_i - 1 ) attributes = EverythingButTheKitchenSink :: SpoonacularApi . recipe_info ( recipe_index ) recipe_object = EverythingButTheKitchenSink :: Recipe . all [ recipe_index ] EverythingButTheKitchenSink :: TransformData . get_time_and_url ( attributes , recipe_object ) recipe_object else user_recipe_choice end end
will prompt/gets recipe choice and will send to api.
will prompt / gets recipe choice and will send to api .