Class: Chef::Resource::RubyBlock

Inherits:
Chef::Resource show all
Defined in:
lib/engineyard-hudson/cli/server/templates/cookbooks/main/libraries/ruby_block.rb,
lib/engineyard-hudson/cli/install/templates/cookbooks/main/libraries/ruby_block.rb

Instance Method Summary collapse

Constructor Details

#initialize(name, collection = nil, node = nil) ⇒ RubyBlock


5
6
7
8
9
10
# File 'lib/engineyard-hudson/cli/server/templates/cookbooks/main/libraries/ruby_block.rb', line 5

def initialize(name, collection=nil, node=nil)
  super(name, collection, node)
  @resource_name = :ruby_block
  @action = :create
  @allowed_actions.push(:create)
end

Instance Method Details

#block(&block) ⇒ Object


12
13
14
15
16
17
18
# File 'lib/engineyard-hudson/cli/server/templates/cookbooks/main/libraries/ruby_block.rb', line 12

def block(&block)
  if block
    @block = block
  else
    @block
  end
end