[Rails] Re: in Rails, what is the main (global) scope called?

2012-09-26 Thread John Merlino
Top-level methods or constants defined outside of any class or module are implicitly defined in Object. On Sep 21, 1:30 pm, John Merlino stoici...@aol.com wrote: For example, you see filescalled rails/actionpack/lib/action_controller/base.rb which adds methods and such to the open module

[Rails] Re: in Rails, what is the main (global) scope called?

2012-09-26 Thread 7stud --
Methods attach themselves to whatever the current class is when they are defined. If self is a class when the method is defined, then the method becomes an instance method in that class. If self is not a class when the method is defined, then the current class is self's class. puts self