def []=(name,value)
    name = name.intern

    fail("no parameter named '#{name}'") unless self.class.validattr?(name)

    if name == :name && nv = name_var
      name = nv
    end
    raise Puppet::Error.new("Got nil value for #{name}") if value.nil?

    property = self.newattr(name)

    if property
      begin
        # make sure the parameter doesn't have any errors
        property.value = value
      rescue Puppet::Error, ArgumentError => detail
        error = Puppet::ResourceError.new(_("Parameter %{name} failed on %{ref}: %{detail}") %
                                              { name: name, ref: ref, detail: detail })
        adderrorcontext(error, detail)
        raise error
      end
    end

    nil
  end
def []=(name,value)
    name = name.intern

    fail("no parameter named '#{name}'") unless self.class.validattr?(name)

    if name == :name && nv = name_var
      name = nv
    end
    raise Puppet::Error.new("Got nil value for #{name}") if value.nil?

    property = self.newattr(name)

    if property
      begin
        # make sure the parameter doesn't have any errors
        property.value = value
      rescue Puppet::Error, ArgumentError => detail
        error = Puppet::ResourceError.new(_("Parameter %{name} failed on %{ref}: %{detail}") %
                                              { name: name, ref: ref, detail: detail })
        adderrorcontext(error, detail)
        raise error
      end
    end

    nil
  end
Sets the 'should' (wanted state) value of a property, or the value of a parameter.
 @return
 @raise [Puppet::Error] if the setting of the value fails, or if the given name is nil.
 @raise [Puppet::ResourceError] when the parameter validation raises Puppet::Error or
   ArgumentError