Skip to contents

An RecipeBook-class object contains 3 components; 1. a set of recipes retrievable using recipes(), 2. a meal plan created using create_meal_plan() and 3. a shopping list created using create_shopping_list().

Usage

RecipeBook(names, ingredients)

# S4 method for RecipeBook
show(object)

# S4 method for RecipeBook
names(x)

# S4 method for RecipeBook
length(x)

recipes(object)

meal_plan(object)

shopping_list(object)

favourites(x)

recipes(object) <- value

Arguments

names

character() containing the name of of recipes.

ingredients

character() or list() of Ingredient-class objects. If a character(), will be read in using read_ingredients().

object

a RecipeBook-class object.

x

a RecipeBook-class object.

value

tibble::tibble() which will be used to set the recipes slot.

Slots

recipes

tibble::tibble() storing the names, ingredients and favourites status of recipes.

meal_plan

tibble::tibble() storing a meal plan, created by create_meal_plan().

shopping_list

tibble::tibble() storing a shopping list, created by create_shopping_list().

Constructor

RecipeBook(names, ingredients) creates an object of RecipeBook-class.

Displaying

show(recipebook) prints the recipes as a tibble::tibble().

Getters

names(recipebook) obtains the names of the recipes.

length(recipebook) obtains the number of recipes.

recipes(recipebook) obtains the recipes as a tibble::tibble().

meal_plan(recipebook) obtains the meal_plan as a tibble::tibble().

shopping_list(recipebook) obtains the shopping_list as a tibble::tibble().

favourites(recipebook) obtains the recipes marked as favourites.

Setters

recipes(object) <- value can be used to set the recipes.