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
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
2 matches
Mail list logo