Method: Chef::Mixin::Properties::ClassMethods#properties

Defined in:
lib/chef/mixin/properties.rb

#properties(include_superclass = true) ⇒ Hash<Symbol,Property>

The list of properties defined on this resource.

Everything defined with ‘property` is in this list.

Parameters:

  • include_superclass (Boolean) (defaults to: true)

    ‘true` to include properties defined on superclasses; `false` or `nil` to return the list of properties directly on this class.

Returns:



20
21
22
23
24
25
26
27
28
# File 'lib/chef/mixin/properties.rb', line 20

def properties(include_superclass = true)
  if include_superclass
    result = {}
    ancestors.reverse_each { |c| result.merge!(c.properties(false)) if c.respond_to?(:properties) }
    result
  else
    @properties ||= {}
  end
end