Method: Chef::Resource#declared_key
- Defined in:
- lib/chef/resource.rb
#declared_key ⇒ Object
We usually want to store and reference resources by their declared type and not the actual type that was looked up by the Resolver (IE, “package” becomes YumPackage class). If we have not been provided the declared key we want to fall back on the old to_s key.
1403 1404 1405 1406 1407 |
# File 'lib/chef/resource.rb', line 1403 def declared_key return to_s if declared_type.nil? "#{declared_type}[#{@name}]" end |