Class: Chef::Resource::RubyBlock

Inherits:
Chef::Resource show all
Defined in:
lib/engineyard-recipes/generators/templates/cookbooks/main/libraries/ruby_block.rb,
lib/engineyard-recipes/generators/init_resin_chef_generator/templates/cookbooks/main/libraries/ruby_block.rb

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of RubyBlock.



5
6
7
8
9
10
# File 'lib/engineyard-recipes/generators/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-recipes/generators/templates/cookbooks/main/libraries/ruby_block.rb', line 12

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