~ubuntu-branches/ubuntu/karmic/chef/karmic

« back to all changes in this revision

Viewing changes to chef/lib/chef/resource/ruby_block.rb

  • Committer: Bazaar Package Importer
  • Author(s): Joshua Timberman
  • Date: 2009-08-12 12:18:48 UTC
  • Revision ID: james.westby@ubuntu.com-20090812121848-yl38hpd7nfsl51xz
Tags: upstream-0.7.8
ImportĀ upstreamĀ versionĀ 0.7.8

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
class Chef
 
2
  class Resource
 
3
    class RubyBlock < Chef::Resource
 
4
      def initialize(name, collection=nil, node=nil)
 
5
        super(name, collection, node)
 
6
        @resource_name = :ruby_block
 
7
        @action = :create
 
8
        @allowed_actions.push(:create)
 
9
      end
 
10
 
 
11
      def block(&block)
 
12
        if block
 
13
          @block = block
 
14
        else
 
15
          @block
 
16
        end
 
17
      end
 
18
    end
 
19
  end
 
20
end