def newattr(name)
    if name.is_a?(Class)
      klass = name
      name = klass.name
    end

    unless klass = self.class.attrclass(name)
      raise Puppet::Error, "Resource type #{self.class.name} does not support parameter #{name}"
    end

    if provider and ! provider.class.supports_parameter?(klass)
      missing = klass.required_features.find_all { |f| ! provider.class.feature?(f) }
      debug "Provider %s does not support features %s; not managing attribute %s" % [provider.class.name, missing.join(", "), name]
      return nil
    end

    return @parameters[name] if @parameters.include?(name)

    @parameters[name] = klass.new(:resource => self)
  end
def newattr(name)
    if name.is_a?(Class)
      klass = name
      name = klass.name
    end

    unless klass = self.class.attrclass(name)
      raise Puppet::Error, "Resource type #{self.class.name} does not support parameter #{name}"
    end

    if provider and ! provider.class.supports_parameter?(klass)
      missing = klass.required_features.find_all { |f| ! provider.class.feature?(f) }
      debug "Provider %s does not support features %s; not managing attribute %s" % [provider.class.name, missing.join(", "), name]
      return nil
    end

    return @parameters[name] if @parameters.include?(name)

    @parameters[name] = klass.new(:resource => self)
  end
Registers an attribute to this resource type instance.
 Requires either the attribute name or class as its argument.
 This is a noop if the named property/parameter is not supported
 by this resource. Otherwise, an attribute instance is created
 and kept in this resource's parameters hash.
 @overload newattr(name)
   @param name [Symbol] symbolic name of the attribute
 @overload newattr(klass)
   @param klass [Class] a class supported as an attribute class, i.e. a subclass of
     Parameter or Property
 @return [Object] An instance of the named Parameter or Property class associated
   to this resource type instance, or nil if the attribute is not supported