On 12/20/2011 10:21 AM, Intransition wrote:
>
>  >> charlie = Class.new do
> ?> def initialize
>  >> @@brown = "#802A2A"
>  >> end
>  >> end
> => #<Class:0x00000002a8b838>
>  >> charlie.new
> (irb):8: warning: class variable access from toplevel
> => #<#<Class:0x00000002a8b838>:0x00000002a85528>
>

Scoping, apparently...

class Outer
   @@brown = "Outer's var"
   charlie = Class.new do
     def initialize
       p @@brown
     end
   end
   charlie.new # ==> "Outer's var"
end