Sha256: 95d41dbd105be3625b950ff150b0fda3f596c261ebd7e1c0b799dbf8aec5f9a3

Contents?: true

Size: 665 Bytes

Versions: 3

Compression:

Stored size: 665 Bytes

Contents

# frozen_string_literal: true

require 'puppet/util'
require 'puppet/resource_api/parameter'

# Class containing read only parameter functionality for ResourceApi.
class Puppet::ResourceApi::ReadOnlyParameter < Puppet::ResourceApi::Parameter
  # This method raises error if the there is attempt to set value in parameter.
  # @return [Puppet::ResourceError] the error with information.
  def value=(value)
    raise Puppet::ResourceError,
          "Attempting to set `#{@attribute_name}` read_only attribute value " \
          "to `#{value}`"
  end

  # used internally
  # @returns the final mungified value of this parameter
  def rs_value
    @value
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
puppet-resource_api-1.9.0 lib/puppet/resource_api/read_only_parameter.rb
puppet-resource_api-1.8.18 lib/puppet/resource_api/read_only_parameter.rb
puppet-resource_api-1.8.14 lib/puppet/resource_api/read_only_parameter.rb