Class: Hypertemplate::Recipes
- Inherits:
-
Object
- Object
- Hypertemplate::Recipes
- Defined in:
- lib/hypertemplate/recipes.rb
Instance Method Summary collapse
- #[](recipe_name) ⇒ Object
- #add(recipe_name, &block) ⇒ Object
-
#initialize ⇒ Recipes
constructor
A new instance of Recipes.
- #list ⇒ Object
- #remove(recipe_name) ⇒ Object
Constructor Details
#initialize ⇒ Recipes
Returns a new instance of Recipes.
4 5 6 |
# File 'lib/hypertemplate/recipes.rb', line 4 def initialize @recipes = {} end |
Instance Method Details
#[](recipe_name) ⇒ Object
16 17 18 |
# File 'lib/hypertemplate/recipes.rb', line 16 def [](recipe_name) @recipes[recipe_name] end |
#add(recipe_name, &block) ⇒ Object
8 9 10 |
# File 'lib/hypertemplate/recipes.rb', line 8 def add(recipe_name, &block) @recipes[recipe_name] = block end |
#list ⇒ Object
20 21 22 |
# File 'lib/hypertemplate/recipes.rb', line 20 def list @recipes.keys end |
#remove(recipe_name) ⇒ Object
12 13 14 |
# File 'lib/hypertemplate/recipes.rb', line 12 def remove(recipe_name) @recipes.delete(recipe_name) end |