From 326d0739f111d9411443f713e29f73cb5ffd1357 Mon Sep 17 00:00:00 2001 From: dreamcat4 Date: Thu, 22 Oct 2009 15:17:55 +0100 Subject: [PATCH] Instance method for calling self.class.recipe (less ugly) Example: class SampleManifest < ShadowPuppet::Manifest def my_recipe recipe :other_recipe end end Rather than: class SampleManifest < ShadowPuppet::Manifest def my_recipe self.class.recipe :other_recipe end end --- lib/shadow_puppet/manifest.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/shadow_puppet/manifest.rb b/lib/shadow_puppet/manifest.rb index 101b6de..5d8d438 100644 --- a/lib/shadow_puppet/manifest.rb +++ b/lib/shadow_puppet/manifest.rb @@ -119,6 +119,17 @@ def self.recipe(*methods) end end + # Access to a recipe of the class of this instance. + # + # class SampleManifest < ShadowPuppet::Manifest + # def my_recipe + # recipe :other_recipe + # end + # end + def recipe(*methods) + self.class.recipe *methods + end + # A hash describing any configuration that has been # performed on the class. Modify this hash by calling configure: #