Suppose I write a Ruby script with not class definition. I can still create class variables and class level instance variables:
@@var = "class variable!";
@var = "class instance variable!";
puts @@var;
puts @var;
These variables belong to a top-level context object.
Is this top-level context object similar to the global context in JavaScript in that it can serve as a kind of top-level namespace? For example, is there a way to do something like this in Ruby using the "top-level context object"?
var arrStore1 = new Ext.data.ArrayStore({/*...*/});
/* same call again, using the global context object */
var global = window;
var arrStore2 = new global.Ext.data.ArrayStore({/*...*/});