+ if resource.resource_type.is_a? Puppet::Resource::Type >> + resource.resource_type.instantiate_resource(scope, resource) >> + else >> + scope.compiler.add_resource(scope, resource) >> + end >> > > I don't like this one. Can we use duck typing here instead of testing for > ancestors? >
Agreed. Also, since scope.compiler.add_resource(scope, resource) is being called somewhere in the middle of instantiate_resource, it looks like this decision is being made at the wrong level. If the call to add_resource *must* be in the middle it should probably be moved to the base instantiate_resource method and called as super in the Puppet::Resource::Type version; if it's not obligatory it should be pulled out, making the base version of instantiate_method null. If neither of these is acceptable it's probably indicative that it's all in the wrong place. -- M ----------------------------------------------------------- The power of accurate observation is commonly called cynicism by those who have not got it. ~George Bernard Shaw ------------------------------------------------------------ -- You received this message because you are subscribed to the Google Groups "Puppet Developers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.
