Method: Chef::Resource.state_attrs

Defined in:
lib/chef/resource.rb

.state_attrs(*names) ⇒ Array<Symbol>

Deprecated.

Use state_properties.keys instead. Note that when you declare properties with property: properties are added to state_properties by default, and can be turned off with ‘desired_state: false`

“‘ruby property :x # part of desired state property :y, desired_state: false # not part of desired state “`

Set or return the list of “state properties” implemented by the Resource subclass.

Equivalent to calling #state_properties and getting state_properties.keys.

Parameters:

  • names (Array<Symbol>)

    A list of property names to set as desired state.

Returns:

  • (Array<Symbol>)

    All property names with desired state.



810
811
812
# File 'lib/chef/resource.rb', line 810

def self.state_attrs(*names)
  state_properties(*names).map(&:name)
end