module ChefCompat::CopiedFromChef::Chef::Mixin::Properties

Private Class Methods

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

Private Instance Methods

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 files/lib/chef_compat/copied_from_chef/chef/mixin/properties.rb, line 294
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 files/lib/chef_compat/copied_from_chef/chef/mixin/properties.rb, line 307
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