Method: Puppet::Type.attrclass

Defined in:
lib/vendor/puppet/type.rb

.attrclass(name) ⇒ Object

Find the class associated with any given attribute.



71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/vendor/puppet/type.rb', line 71

def self.attrclass(name)
  @attrclasses ||= {}

  # We cache the value, since this method gets called such a huge number
  # of times (as in, hundreds of thousands in a given run).
  unless @attrclasses.include?(name)
    @attrclasses[name] = case self.attrtype(name)
    when :property; @validproperties[name]
    when :meta; @@metaparamhash[name]
    when :param; @paramhash[name]
    end
  end
  @attrclasses[name]
end