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