I'm looking for some tips and understanding on how user defined attributes
work with newproperty() calls.
For example, lets say I am defining a new type and I have:
Puppet::Type.newtype(:foobar) do
ensurable
newparam(:name) do
desc "some description here"
isnamevar
end
newproperty(:baz, :a => :b) do
desc "some description here"
end
end
tracing through the calls in type.rb and util/classgen.rb I see that we get
here:
if attrs = options[:attributes]
attrs.each do |param, value|
method = param.to_s + "="
klass.send(method, value) if klass.respond_to? method <<------
end
end
What do I need to define in order to get the klass.send(...) call to
process? Everything I've tried so far fails to register a method with the
klass so its never ever sent. I can see that the attrs hash has {:a => :b}
so I know it's there, I just don't know how to get it added to the klass
itself.
Also, once I have the type able to accept user defined attributes, how do I
access them in the provider itself?
Thanks for any help you can provide!
--
You received this message because you are subscribed to the Google Groups
"Puppet Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-dev.
For more options, visit https://groups.google.com/groups/opt_out.