On 05/27/2014 06:05 PM, Trevor Vaughan wrote: > https://www.onyxpoint.com/storing-puppet-provider-metadata-for-single-instance-application/. > > However, I've run into a bit of an issue with Ruby 2 in that I can't > determine the proper method for keeping this technique properly > functional and getting rid of the following warning "warning: class > variable access from toplevel". > > This is generated each and every time that I access a class variable and > I'm not quite sure what the correct technique is for fixing the code.
I'll be honest - the whole scoping in Ruby is pretty mysterious to me at times. If I understood and remember correctly, @@ only does what you need when used inside instance methods. In class methods or outside of methods, it would actually refer a member of the class's class (which is Class? or something...), so it's only @ for the declaration at class scope. Again, I may be totally on the wrong track. Best, Felix -- 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 view this discussion on the web visit https://groups.google.com/d/msgid/puppet-dev/5384BA0D.5000803%40alumni.tu-berlin.de. For more options, visit https://groups.google.com/d/optout.
