On Wednesday, May 9, 2012 at 1:55 PM, Philip Brown wrote: > I'm interested in the pattern of > > if provider.respond_to?() > > > In particular, > > provider.validate if provider.respond_to?(:validate) > > I have > > def validate > blah blah > > in my provider, but that does not seem to be enough. > That *should* work. What respond_to? means is simply "does this object have a public method by this name?" What's the behavior you're seeing? Is it just not calling validate? And, importantly, are you certain it's not calling validate?
Beyond that, is the value of `provider` what you expect it to be? Do you have multiple providers, and perhaps the wrong one is being used? Where have you defined validate, and where are you calling it? > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Developers" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/puppet-dev/-/XkJcdSByG5UJ. > To post to this group, send email to [email protected] > (mailto:[email protected]). > To unsubscribe from this group, send email to > [email protected] > (mailto:[email protected]). > For more options, visit this group at > http://groups.google.com/group/puppet-dev?hl=en. -- 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.
