module Chef::Mixin::Properties

Public Class Methods

included(other) click to toggle source
# File lib/chef/mixin/properties.rb, line 279
def self.included(other)
  other.extend ClassMethods
end

Public Instance Methods

property_description(name) click to toggle source

The description of the property

@param name [Symbol] The name of the property. @return [String] The description of the property.

# File lib/chef/mixin/properties.rb, line 316
def property_description(name)
  property = self.class.properties[name.to_sym]
  raise ArgumentError, "Property #{name} is not defined in class #{self}" if !property
  property.description
end
property_is_set?(name) click to toggle source

Whether this property has been set (or whether it has a default that has been retrieved).

@param name [Symbol] The name of the property. @return [Boolean] `true` if the property has been set.

# File lib/chef/mixin/properties.rb, line 292
def property_is_set?(name)
  property = self.class.properties[name.to_sym]
  raise ArgumentError, "Property #{name} is not defined in class #{self}" if !property
  property.is_set?(self)
end
reset_property(name) click to toggle source

Clear this property as if it had never been set. It will thereafter return the default. been retrieved).

@param name [Symbol] The name of the property.

# File lib/chef/mixin/properties.rb, line 305
def reset_property(name)
  property = self.class.properties[name.to_sym]
  raise ArgumentError, "Property #{name} is not defined in class #{self}" if !property
  property.reset(self)
end