Class: Puppet::ResourceApi::ReadOnlyParameter

Inherits:
Parameter
  • Object
show all
Defined in:
lib/puppet/resource_api/read_only_parameter.rb

Overview

Class containing read only parameter functionality for ResourceApi.

Instance Attribute Summary

Attributes inherited from Parameter

#value

Instance Method Summary collapse

Methods inherited from Parameter

#initialize

Constructor Details

This class inherits a constructor from Puppet::ResourceApi::Parameter

Instance Method Details

#rs_valueObject

used internally



18
19
20
# File 'lib/puppet/resource_api/read_only_parameter.rb', line 18

def rs_value
  @value
end

#value=(value) ⇒ Puppet::ResourceError

This method raises error if the there is attempt to set value in parameter.

Returns:

  • (Puppet::ResourceError)

    the error with information.

Raises:

  • (Puppet::ResourceError)


10
11
12
13
14
# File 'lib/puppet/resource_api/read_only_parameter.rb', line 10

def value=(value)
  raise Puppet::ResourceError,
        "Attempting to set `#{@attribute_name}` read_only attribute value " \
        "to `#{value}`"
end