Skip to content

Commit

Permalink
Instance method for calling self.class.recipe (less ugly)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
dreamcat4 committed Oct 22, 2009
1 parent 0dc775a commit 326d073
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/shadow_puppet/manifest.rb
Expand Up @@ -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:
#
Expand Down

0 comments on commit 326d073

Please sign in to comment.