Class: Hypertemplate::Recipes

Inherits:
Object
  • Object
show all
Defined in:
lib/hypertemplate/recipes.rb

Instance Method Summary collapse

Constructor Details

#initializeRecipes

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

#listObject



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