Class: Recipe

Recipe


new Recipe(recipe_config)

The Recipe controls a list of Operations and the Dish they operate on.

Parameters:
Name Type Description
recipe_config Object
Author:
  • <p>n1474335 [n1474335@gmail.com]</p>
License:
  • Apache-2.0
Source:

Methods


<private> _parse_config(recipe_config)

Reads and parses the given config.

Parameters:
Name Type Description
recipe_config Object
Source:

get_config()

Returns the value of the Recipe as it should be displayed in a recipe config.

Source:
Returns:
Type
*

add_operation(operation)

Adds a new Operation to this Recipe.

Parameters:
Name Type Description
operation Operation
Source:

add_operations(operations)

Adds a list of Operations to this Recipe.

Parameters:
Name Type Description
operations Array.<Operation>
Source:

set_breakpoint(position, value)

Set a breakpoint on a specified Operation.

Parameters:
Name Type Description
position number

The index of the Operation

value boolean
Source:

remove_breaks_up_to(pos)

Remove breakpoints on all Operations in the Recipe up to the specified position. Used by Flow
Control Fork operation.

Parameters:
Name Type Description
pos number
Source:

contains_flow_control()

Returns true if there is an Flow Control Operation in this Recipe.

Source:
Returns:
Type
boolean

last_op_index( [start_index])

Returns the index of the last Operation index that will be executed, taking into account disabled
Operations and breakpoints.

Parameters:
Name Type Argument Default Description
start_index number <optional>
0

The index to start searching from

Source:
Returns:

(number}


execute(dish [, start_from])

Executes each operation in the recipe over the given Dish.

Parameters:
Name Type Argument Default Description
dish Dish
start_from number <optional>
0

The index of the Operation to start executing from

Source:
Returns:
  • The final progress through the recipe
Type
number

to_string()

Returns the recipe configuration in string format.

Source:
Returns:
Type
string

from_string(recipe_str)

Creates a Recipe from a given configuration string.

Parameters:
Name Type Description
recipe_str string
Source: