class Puppet::ResourceApi::Parameter

Class containing parameter functionality for ResourceApi.

Attributes

value[R]

Public Class Methods

new(type_name, data_type, attribute_name, resource_hash, _referrable_type = nil) click to toggle source

This initialize takes arguments and sets up new parameter. @param type_name the name of the Puppet Type @param data_type the data type of parameter instance @param attribute_name the name of attribue of the parameter @param resource_hash the resource hash instance which is passed to the parent class.

Calls superclass method
# File lib/puppet/resource_api/parameter.rb, line 18
def initialize(type_name, data_type, attribute_name, resource_hash, _referrable_type = nil)
  @type_name = type_name
  @data_type = data_type
  @attribute_name = attribute_name
  super(**resource_hash) # Pass resource to parent Puppet class.
end

Public Instance Methods

rs_value() click to toggle source

used internally @returns the final mungified value of this parameter

# File lib/puppet/resource_api/parameter.rb, line 39
def rs_value
  @value
end
value=(value) click to toggle source

This method assigns value to the parameter and cleans value. @param value the value to be set and clean @return [type] the cleaned value

# File lib/puppet/resource_api/parameter.rb, line 28
def value=(value)
  @value = Puppet::ResourceApi::DataTypeHandling.mungify(
    @data_type,
    value,
    "#{@type_name}.#{@attribute_name}",
    Puppet::ResourceApi.caller_is_resource_app?,
  )
end