|
Properties exist which are read-only. Examples include the "mtime" property of the File resource and the "power_state" property of the Vsphere_vm resource.
Today, these read-only properties are implemented by making the validate method fail. This is a hack.
In order to support better automatic documentation and validation there should exist a way to designate a property as read-only when defining them. A possible implementation would be a flag that can be passed when defining the property, similar to :array_matching.
newproperty(:minute, :ready_only => true)
|
A property defined as read-only should not need a custom validate function, and it should be possible to enumerate read-only properties for a type so as to separate them from read-write properties. This can be useful in auto documentation, pretty-print generation of Puppet code, or editing tools that integrate with Puppet's RAL.
|