title: What is the proper way to access class variables in Ruby 1.9?
body: <p>I'm trying to set some class variables to store paths in a Rails application (but I think this more a ruby question)</p>
  
  <p>Basically my class looks like this</p>
  
  <pre><code>class Image &lt; ActiveRecord::Base
  
     @@path_to_folder = "app/assets"
     @@images_folder = "upimages"
     @@path_to_images = File.join(@@path_to_folder, @@images_folder)
  
  end
  </code></pre>
  
  <p>But when I try to access <code>@@path_to_images</code> from my controller by doing <code>Image.path_to_images</code>, I get a NoMethodError</p>
  
  <p>When I try with <code>Image.class_eval( @@path_to_images )</code>, I get <code>uninitialized class variable @@path_to_images in ImagesController</code></p>
  
  <p>I've searched around and all I've seen says those would work, so I'm very confused about this</p>
  
  <p>What's more, I tried defining simple classes with the ruby console like so</p>
  
  <pre><code> class Bidule
       @@foo = "foo"
       Bar = "bar"
   end
  </code></pre>
  
  <p>And so I tried, I think, all the ways possible (previous 2 included) to access them but no way I always get an exception raised</p>