Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Cookbook
- attr_accessor :title, :author
- def initialize
- @recipes = []
- end
- def method_missing (m,*args,&block)
- @recipes.send(m,*args,&block)
- end
- end
- cb = Cookbook.new
- cb << recipe_for_cake
- cb << recipe_for_chicken
- beef_dishes = cb.select {|recipe| recipe.main_ingredient == "beef" }
Advertisement
Add Comment
Please, Sign In to add comment