Module: Chef::Mixin::Properties
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
Instance Method Summary collapse
-
#property_is_set?(name) ⇒ Boolean
Whether this property has been set (or whether it has a default that has been retrieved).
-
#reset_property(name) ⇒ Object
Clear this property as if it had never been set.
Methods included from ParamsValidate
#lazy, #set_or_return, #validate
Class Method Details
.included(other) ⇒ Object
270 271 272 |
# File 'lib/chef/mixin/properties.rb', line 270 def self.included(other) other.extend ClassMethods end |
Instance Method Details
#property_is_set?(name) ⇒ Boolean
Whether this property has been set (or whether it has a default that has been retrieved).
283 284 285 286 287 |
# File 'lib/chef/mixin/properties.rb', line 283 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) ⇒ Object
Clear this property as if it had never been set. It will thereafter return the default. been retrieved).
296 297 298 299 300 |
# File 'lib/chef/mixin/properties.rb', line 296 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 |