Method: Chef::Resource.identity_attr

Defined in:
lib/chef/resource.rb

.identity_attr(name = nil) ⇒ Symbol

Deprecated.

identity_property should be used instead.

Set a property as the “identity attribute” for this resource.

Identical to calling #identity_property.first.key.

Parameters:

  • name (Symbol) (defaults to: nil)

    The name of the property to set.

Returns:

Raises:

  • (ArgumentError)

    If no arguments are passed and the resource has more than one identity property.



861
862
863
864
865
866
# File 'lib/chef/resource.rb', line 861

def self.identity_attr(name = nil)
  property = identity_property(name)
  return nil unless property

  property.name
end