Class: FPM::Cookery::Book

Inherits:
Object
  • Object
show all
Defined in:
lib/fpm/cookery/book.rb

Class Method Summary collapse

Class Method Details

.load_recipe(filename, &callback) ⇒ Object

Load the given file and instantiate an object. Wrap the class in an anonymous module to avoid namespace cluttering. (see Kernel.load)



6
7
8
9
# File 'lib/fpm/cookery/book.rb', line 6

def self.load_recipe(filename, &callback)
  Kernel.load(filename, true)
  callback.call(@recipe.new(filename))
end

.loaded_recipe(klass) ⇒ Object



11
12
13
# File 'lib/fpm/cookery/book.rb', line 11

def self.loaded_recipe(klass)
  @recipe = klass
end