Method: Chef::Resource#cookbook_version

Defined in:
lib/chef/resource.rb

#cookbook_versionObject

The cookbook in which this Resource was defined (if any).

Returns:

  • Chef::CookbookVersion The cookbook in which this Resource was defined.



1538
1539
1540
1541
1542
# File 'lib/chef/resource.rb', line 1538

def cookbook_version
  if cookbook_name && cookbook_name != "@recipe_files"
    run_context.cookbook_collection[cookbook_name]
  end
end