Method: Chef::Recipe#from_hash
- Defined in:
- lib/chef/recipe.rb
#from_hash(hash) ⇒ Object
104 105 106 107 108 109 110 111 112 113 114 |
# File 'lib/chef/recipe.rb', line 104 def from_hash(hash) hash["resources"].each do |rhash| type = rhash.delete("type").to_sym name = rhash.delete("name") res = declare_resource(type, name) rhash.each do |key, value| # FIXME?: we probably need a way to instance_exec a string that contains block code against the property? res.send(key, value) end end end |