Module: Chef::Mixin::Properties

Includes:
ParamsValidate
Included in:
Resource
Defined in:
lib/chef/mixin/properties.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ParamsValidate

#lazy, #set_or_return, #validate

Class Method Details

.included(other) ⇒ Object



279
280
281
# File 'lib/chef/mixin/properties.rb', line 279

def self.included(other)
  other.extend ClassMethods
end

Instance Method Details

#property_description(name) ⇒ String

The description of the property

Raises:

  • (ArgumentError)


316
317
318
319
320
# 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) ⇒ Boolean

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

Raises:

  • (ArgumentError)


292
293
294
295
296
# 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) ⇒ Object

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

Raises:

  • (ArgumentError)


305
306
307
308
309
# 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